Skip to content

Commit 21ad421

Browse files
committed
wip: create separate goldboot-linux crate
1 parent f3bea8d commit 21ad421

File tree

22 files changed

+114
-122
lines changed

22 files changed

+114
-122
lines changed

.github/workflows/check.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ jobs:
2727
name: stable / fmt
2828
steps:
2929
- uses: actions/checkout@v4
30-
with:
31-
submodules: true
3230
- name: Install stable
3331
uses: dtolnay/rust-toolchain@stable
3432
with:
@@ -49,8 +47,6 @@ jobs:
4947
toolchain: [stable, beta]
5048
steps:
5149
- uses: actions/checkout@v4
52-
with:
53-
submodules: true
5450
- name: Install ${{ matrix.toolchain }}
5551
uses: dtolnay/rust-toolchain@master
5652
with:
@@ -71,8 +67,6 @@ jobs:
7167
steps:
7268
- run: sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev
7369
- uses: actions/checkout@v4
74-
with:
75-
submodules: true
7670
- name: Install nightly
7771
uses: dtolnay/rust-toolchain@nightly
7872
- name: cargo doc
@@ -91,8 +85,6 @@ jobs:
9185
name: ubuntu / ${{ matrix.msrv }}
9286
steps:
9387
- uses: actions/checkout@v4
94-
with:
95-
submodules: true
9688
- name: Install ${{ matrix.msrv }}
9789
uses: dtolnay/rust-toolchain@master
9890
with:

.github/workflows/release.yml

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,20 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
target:
33-
# TODO: re-enable these. Problems arise with cross-rs because the base
34-
# image doesn't have libgtk-4-dev...
35-
# - aarch64-unknown-linux-gnu
36-
# - aarch64-unknown-linux-musl
37-
# - i686-unknown-linux-gnu
33+
- aarch64-unknown-linux-gnu
34+
- aarch64-unknown-linux-musl
35+
- i686-unknown-linux-gnu
3836
- x86_64-unknown-linux-gnu
39-
# - x86_64-unknown-linux-musl
37+
- x86_64-unknown-linux-musl
4038
steps:
41-
- name: Install dependencies
42-
run: |
43-
sudo apt-get update
44-
sudo apt-get install -y libudev-dev libgtk-4-dev libglib2.0-dev
45-
4639
- uses: actions/checkout@v4
4740
with:
4841
fetch-tags: true
4942

50-
- uses: actions-rs/toolchain@v1
51-
with:
52-
toolchain: nightly
53-
override: true
54-
5543
- uses: actions-rs/cargo@v1
5644
with:
5745
command: build
58-
args: --release --target ${{ matrix.target }} --features gui
46+
args: --release --target ${{ matrix.target }} --exclude goldboot-linux
5947

6048
- uses: actions/upload-artifact@v4
6149
with:
@@ -79,26 +67,45 @@ jobs:
7967
done
8068
8169
goldboot-linux:
82-
runs-on: ubuntu-latest
70+
runs-on: ubuntu-24.04
8371
needs: linux
8472
steps:
85-
- uses: actions/download-artifact@v4
73+
- name: Install dependencies
74+
run: |
75+
sudo apt-get update
76+
sudo apt-get install -y libudev-dev libgtk-4-dev libglib2.0-dev
77+
78+
- uses: actions-rs/toolchain@v1
8679
with:
87-
name: goldboot-x86_64-unknown-linux-musl
88-
path: linux-amd64
80+
toolchain: nightly
81+
override: true
82+
83+
- uses: actions-rs/cargo@v1
84+
with:
85+
command: build
86+
args: --release
8987

9088
- name: Build goldboot-linux image x86_64
9189
run: |
9290
export RUST_BACKTRACE=1
9391
export RUST_LOG=debug
94-
chmod +x linux-amd64/goldboot
95-
linux-amd64/goldboot init --os Goldboot
96-
linux-amd64/goldboot cast --output goldboot-linux-x86_64.gb .
92+
target/release/goldboot init --os Goldboot --executable target/release/goldboot-linux
93+
target/release/goldboot cast --output goldboot-linux-x86_64.gb .
9794
98-
- uses: actions/upload-artifact@v4
99-
with:
100-
name: goldboot-linux-x86_64.gb
101-
path: goldboot-linux-x86_64.gb
95+
- name: Upload artifacts to release
96+
env:
97+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
GH_REPO: ${{ github.repository }}
99+
run: |
100+
for tag in $(git tag --points-at HEAD); do
101+
if [ "${tag%-*}" = "goldboot-linux" ]; then
102+
mv target/release/${tag%-*} "${tag%-*}_x86_64-unknown-linux-gnu"
103+
gh release upload "${tag}" "${tag%-*}_x86_64-unknown-linux-gnu"
104+
105+
mv goldboot-linux-x86_64.gb "${tag%-*}_x86_64-unknown-linux-gnu.gb"
106+
gh release upload "${tag}" "${tag%-*}_x86_64-unknown-linux-gnu.gb"
107+
fi
108+
done
102109
103110
macos:
104111
runs-on: macos-latest
@@ -116,7 +123,7 @@ jobs:
116123
- uses: actions-rs/cargo@v1
117124
with:
118125
command: build
119-
args: --release
126+
args: --release --exclude goldboot-linux
120127

121128
- uses: actions/upload-artifact@v4
122129
with:
@@ -150,7 +157,7 @@ jobs:
150157
- uses: actions-rs/cargo@v1
151158
with:
152159
command: build
153-
args: --release
160+
args: --release --exclude goldboot-linux
154161

155162
- uses: actions/upload-artifact@v4
156163
with:
@@ -247,7 +254,6 @@ jobs:
247254
steps:
248255
- uses: actions/checkout@v4
249256
with:
250-
submodules: true
251257
fetch-tags: true
252258

253259
- name: Find version tags
@@ -271,12 +277,14 @@ jobs:
271277
run: |
272278
echo "${AUR_PRIVATE_KEY}" >/tmp/id_rsa
273279
chmod 600 /tmp/id_rsa
274-
cd dist/pacman/${{ matrix.package }}
275280
276281
git config --global user.name "github-actions"
277282
git config --global user.email "[email protected]"
278283
ssh-keyscan -H aur.archlinux.org >/tmp/known_hosts
279284
285+
GIT_SSH_COMMAND='ssh -i /tmp/id_rsa -o UserKnownHostsFile=/tmp/known_hosts' git submodule update --init dist/pacman/${{ matrix.package }}
286+
cd dist/pacman/${{ matrix.package }}
287+
280288
git add .SRCINFO PKGBUILD
281289
git commit -m "release: ${{ steps.get_tags.outputs.pkgver }}"
282290
GIT_SSH_COMMAND='ssh -i /tmp/id_rsa -o UserKnownHostsFile=/tmp/known_hosts' git push -u origin master

.github/workflows/test.yml

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
steps:
3030
- run: sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev libudev-dev libgtk-4-dev libglib2.0-dev
3131
- uses: actions/checkout@v4
32-
with:
33-
submodules: true
3432
- name: Install ${{ matrix.toolchain }}
3533
uses: dtolnay/rust-toolchain@master
3634
with:
@@ -62,61 +60,10 @@ jobs:
6260
# - run: vcpkg install openssl:x64-windows-static-md
6361
# if: runner.os == 'Windows'
6462
- uses: actions/checkout@v4
65-
with:
66-
submodules: true
6763
- name: Install stable
6864
uses: dtolnay/rust-toolchain@stable
6965
- name: cargo generate-lockfile
7066
if: hashFiles('Cargo.lock') == ''
7167
run: cargo generate-lockfile
7268
- name: cargo test
7369
run: cargo test --locked --all-features --all-targets
74-
coverage:
75-
# use llvm-cov to build and collect coverage and outputs in a format that
76-
# is compatible with codecov.io
77-
#
78-
# note that codecov as of v4 requires that CODECOV_TOKEN from
79-
#
80-
# https://app.codecov.io/gh/<user or org>/<project>/settings
81-
#
82-
# is set in two places on your repo:
83-
#
84-
# - https://github.com/jonhoo/guardian/settings/secrets/actions
85-
# - https://github.com/jonhoo/guardian/settings/secrets/dependabot
86-
#
87-
# (the former is needed for codecov uploads to work with Dependabot PRs)
88-
#
89-
# PRs coming from forks of your repo will not have access to the token, but
90-
# for those, codecov allows uploading coverage reports without a token.
91-
# it's all a little weird and inconvenient. see
92-
#
93-
# https://github.com/codecov/feedback/issues/112
94-
#
95-
# for lots of more discussion
96-
runs-on: ubuntu-latest
97-
if: "!contains(github.event.head_commit.message, 'chore: release')"
98-
name: ubuntu / stable / coverage
99-
steps:
100-
- run: sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev libudev-dev libgtk-4-dev libglib2.0-dev
101-
- uses: actions/checkout@v4
102-
with:
103-
submodules: true
104-
- name: Install stable
105-
uses: dtolnay/rust-toolchain@stable
106-
with:
107-
components: llvm-tools-preview
108-
- name: cargo install cargo-llvm-cov
109-
uses: taiki-e/install-action@cargo-llvm-cov
110-
- name: cargo generate-lockfile
111-
if: hashFiles('Cargo.lock') == ''
112-
run: cargo generate-lockfile
113-
- name: cargo llvm-cov
114-
run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info
115-
- name: Record Rust version
116-
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
117-
- name: Upload to codecov.io
118-
uses: codecov/codecov-action@v4
119-
with:
120-
fail_ci_if_error: true
121-
token: ${{ secrets.CODECOV_TOKEN }}
122-
env_vars: OS,RUST

Cargo.lock

Lines changed: 19 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ strip = true
55
members = [
66
"goldboot",
77
"goldboot-image",
8+
"goldboot-linux",
89
"goldboot-macros",
910
"goldboot-registry",
1011
]

goldboot-linux/Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[package]
2+
authors = ["Tyler Cook"]
3+
description = "A command-line application for building goldboot images"
4+
edition = "2021"
5+
homepage = "https://goldboot.org"
6+
license = "AGPL-3.0-only"
7+
name = "goldboot-linux"
8+
repository = "https://github.com/fossable/goldboot"
9+
rust-version = "1.74"
10+
version = "0.0.1"
11+
12+
[dependencies]
13+
block-utils = { version = "0.11.1" }
14+
built = { version = "0.7", features = ["chrono", "semver"] }
15+
clap = { version = "4.4.7", features = ["derive", "string"] }
16+
gdk4 = { version = "0.8.1" }
17+
gdk-pixbuf = { version = "0.19.2" }
18+
glib-macros = { version = "0.19.2" }
19+
glib = { version = "0.19.2" }
20+
goldboot-image = { path="../goldboot-image", version = "0.0.2" }
21+
goldboot = { path="../goldboot", version = "0.0.7" }
22+
gtk4 = { version = "0.8.1", features = ["v4_12"] }
23+
tracing = "0.1.40"
24+
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
25+
ubyte = "0.10.4"

goldboot-linux/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## goldboot-linux
2+
3+
This crate is loaded into a special Linux distribution used to apply `goldboot`
4+
images.

0 commit comments

Comments
 (0)