Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit 48b9182

Browse files
ci: improve ci
Signed-off-by: Henry Gressmann <[email protected]>
1 parent 4cf8b7b commit 48b9182

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[target.aarch64-unknown-linux-musl]
2-
linker="aarch64-linux-gnu-gcc"
2+
linker="aarch64-linux-musl-gcc"
33

44
[target.aarch64-unknown-linux-gnu]
55
linker="aarch64-linux-gnu-gcc"

.github/workflows/build.yaml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,45 @@ env:
1515

1616
jobs:
1717
build-notsd:
18+
if: "${{contains((github.event.inputs.tag || github.ref_name), 'notsd-v')}}"
1819
name: Release ${{ github.event.inputs.tag || github.ref_name }} Docker image
1920
permissions:
2021
packages: write
2122
contents: write
22-
if: "${{contains((github.event.inputs.tag || github.ref_name), 'notsd-v')}}"
2323
runs-on: ubuntu-22.04
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@v4
2727
with:
2828
ref: refs/tags/${{ env.RELEASE_TAG_REF }}
29-
- name: Install latest stable Rust and add targets
29+
- name: Cache Rust dependencies
30+
uses: Swatinem/rust-cache@v2
31+
- name: Install aarch64 gcc
3032
run: |
3133
sudo apt-get update
32-
sudo apt-get install -y gcc-x86-64-linux-gnu gcc-aarch64-linux-gnu musl-tools musl-dev liblmdb-dev
34+
sudo apt-get install -y gcc-aarch64-linux-gnu
35+
- name: Install latest stable Rust and add targets
36+
run: |
3337
rustup toolchain install stable
3438
rustup default stable
35-
rustup target add x86_64-unknown-linux-musl
36-
rustup target add aarch64-unknown-linux-musl
37-
- name: Set up QEMU
38-
uses: docker/setup-qemu-action@v3
39+
rustup target add x86_64-unknown-linux-gnu
40+
rustup target add aarch64-unknown-linux-gnu
3941
- name: Set up Docker Buildx
4042
uses: docker/setup-buildx-action@v3
41-
- uses: Swatinem/rust-cache@v2
4243
- name: Build binaries
4344
run: |
44-
cargo build --release --target x86_64-unknown-linux-musl --locked --bin notsd
45-
cargo build --release --target aarch64-unknown-linux-musl --locked --bin notsd
45+
cargo build --release --target x86_64-unknown-linux-gnu --locked --bin notsd
46+
cargo build --release --target aarch64-unknown-linux-gnu --locked --bin notsd
47+
48+
tar -czf target/x86_64-unknown-linux-gnu/release/notsd-x86_64-unknown-linux-gnu.tar.gz target/x86_64-unknown-linux-gnu/release/notsd
49+
tar -czf target/aarch64-unknown-linux-gnu/release/notsd-aarch64-unknown-linux-gnu.tar.gz target/aarch64-unknown-linux-gnu/release/notsd
4650
- name: Upload binary to Release
4751
uses: softprops/action-gh-release@v1
4852
with:
4953
tag_name: ${{ env.RELEASE_TAG_REF }}
5054
files: |
51-
target/x86_64-unknown-linux-musl/release/notsd-x86_64-unknown-linux.tar.gz
52-
target/aarch64-unknown-linux-musl/release/notsd-aarch64-unknown-linux.tar.gz
55+
target/x86_64-unknown-linux-gnu/release/notsd-x86_64-unknown-linux-gnu.tar.gz
56+
target/aarch64-unknown-linux-gnu/release/notsd-aarch64-unknown-linux-gnu.tar.gz
5357
- name: Login to GitHub Container Registry
5458
uses: docker/login-action@v2
5559
with:
@@ -60,8 +64,8 @@ jobs:
6064
id: out
6165
run: |
6266
mkdir -p /tmp/outputs
63-
mv target/aarch64-unknown-linux-musl/release/notsd /tmp/outputs/notsd-arm64
64-
mv target/x86_64-unknown-linux-musl/release/notsd /tmp/outputs/notsd-amd64
67+
mv target/aarch64-unknown-linux-gnu/release/notsd /tmp/outputs/notsd-arm64
68+
mv target/x86_64-unknown-linux-gnu/release/notsd /tmp/outputs/notsd-amd64
6569
version=$(echo ${{ env.RELEASE_TAG_REF }} | sed 's/notsd-v//')
6670
echo "version=$version" >> $GITHUB_OUTPUT
6771
- name: Build Docker image
@@ -138,11 +142,11 @@ jobs:
138142
run: |
139143
sudo apt-get install -y mingw-w64
140144
141-
- name: Install aarch64 gcc
145+
- name: Install aarch64 musl
142146
if: ${{ matrix.platform.release_for == 'Linux-aarch64' }}
143147
run: |
144-
sudo apt-get update
145-
sudo apt-get install -y gcc-aarch64-linux-gnu
148+
curl -s https://more.musl.cc/11/x86_64-linux-musl/aarch64-linux-musl-cross.tgz | tar -xz
149+
echo "$PWD/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH
146150
147151
- name: Build binary
148152
run: cargo build --release --target ${{ matrix.platform.target }} --locked --bin nots-cli

.github/workflows/ci.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
- "**.rs"
55
- "Cargo.lock"
66

7-
name: Build & Test
7+
name: Test all crates
88

99
jobs:
1010
check:
@@ -13,18 +13,14 @@ jobs:
1313
runs-on: ubuntu-22.04
1414
steps:
1515
- name: Checkout sources
16-
uses: actions/checkout@v2
17-
18-
- name: Install latest stable Rust
19-
uses: actions-rust-lang/setup-rust-toolchain@v1
20-
with:
21-
components: clippy, rustfmt
22-
rustflags: ""
23-
16+
uses: actions/checkout@v4
17+
2418
- uses: Swatinem/rust-cache@v2
2519

26-
- name: Build debug binaries
27-
run: cargo build --all --locked
20+
- name: Install latest stable Rust
21+
run: |
22+
rustup toolchain install stable
23+
rustup default stable
2824
2925
- name: Run cargo check
3026
run: cargo check --all --locked

0 commit comments

Comments
 (0)