From be03e75eb6d1941424297c73797e5e84843cfa25 Mon Sep 17 00:00:00 2001 From: David Perl Date: Wed, 12 Aug 2026 11:07:44 +0200 Subject: [PATCH] build: rpm targets musl --- .gitea/workflows/check-and-lint.yaml | 10 +++++++--- .gitea/workflows/release.yaml | 10 +++++++--- Cargo.toml | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/check-and-lint.yaml b/.gitea/workflows/check-and-lint.yaml index f1c1155..a319e44 100644 --- a/.gitea/workflows/check-and-lint.yaml +++ b/.gitea/workflows/check-and-lint.yaml @@ -47,10 +47,14 @@ jobs: steps: - uses: actions/checkout@v6 - uses: https://github.com/dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-musl - uses: https://github.com/Swatinem/rust-cache@v2 + - name: Install musl toolchain + run: sudo apt-get update && sudo apt-get install -y musl-tools - name: Build RPM run: | - cargo build --release - strip -s target/release/aarel + cargo build --release --target x86_64-unknown-linux-musl + strip -s target/x86_64-unknown-linux-musl/release/aarel cargo install cargo-generate-rpm - cargo generate-rpm + cargo generate-rpm --target x86_64-unknown-linux-musl diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 74ea8c8..0779e2a 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -54,16 +54,20 @@ jobs: steps: - uses: actions/checkout@v6 - uses: https://github.com/dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-musl - uses: https://github.com/Swatinem/rust-cache@v2 + - name: Install musl toolchain + run: sudo apt-get update && sudo apt-get install -y musl-tools - name: Build RPM run: | # Pick up the version bump semantic-release just committed. git pull - cargo build --release - strip -s target/release/aarel + cargo build --release --target x86_64-unknown-linux-musl + strip -s target/x86_64-unknown-linux-musl/release/aarel cargo install cargo-generate-rpm - cargo generate-rpm + cargo generate-rpm --target x86_64-unknown-linux-musl - name: Push to Gitea RPM registry run: | diff --git a/Cargo.toml b/Cargo.toml index bdcf696..fbad349 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ path = "src/main.rs" [package.metadata.generate-rpm] assets = [ - { source = "target/release/aarel", dest = "/usr/local/bin/aarel", mode = "755" }, + { source = "target/x86_64-unknown-linux-musl/release/aarel", dest = "/usr/local/bin/aarel", mode = "755" }, { source = "data/defaults.json", dest = "/etc/aarel/defaults.json", mode = "644", config = true }, ]