Skip to content

Commit

Permalink
ci: simplify arch package build to x86_64 only
Browse files Browse the repository at this point in the history
- Remove cross-compilation matrix for arch packages
- Remove cross and related configuration
- Update dependencies to use systemd-libs
- Simplify build steps for native x86_64 only
- Update cache keys and artifact names for x86_64
  • Loading branch information
aljen committed Dec 1, 2024
1 parent 52e2658 commit e6b4dee
Showing 1 changed file with 9 additions and 42 deletions.
51 changes: 9 additions & 42 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,6 @@ jobs:
name: Build Arch Package
needs: check
runs-on: ubuntu-latest
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
include:
- target: x86_64-unknown-linux-gnu
arch: x86_64
- target: aarch64-unknown-linux-gnu
arch: aarch64
- target: armv7-unknown-linux-gnueabihf
arch: armv7h

container:
image: archlinux:base-devel
options: --privileged
Expand All @@ -172,21 +158,18 @@ jobs:
rustup \
cargo \
pkg-config \
libudev \
systemd
systemd \
systemd-libs
- name: Setup Rust
run: |
rustup default stable
rustup target add ${{ matrix.target }}
rustup target add x86_64-unknown-linux-gnu
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install cross
uses: taiki-e/install-action@cross
targets: x86_64-unknown-linux-gnu

- name: Cache cargo
uses: actions/cache@v3
Expand All @@ -195,28 +178,12 @@ jobs:
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-arch-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-arch-cargo-x86_64-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-arch-cargo-${{ matrix.target }}-
- name: Cache cross
if: matrix.target != 'x86_64-unknown-linux-gnu'
uses: actions/cache@v3
with:
path: ~/.cargo/.cross
key: ${{ runner.os }}-arch-cross-${{ matrix.target }}-${{ hashFiles('Cross.arch.toml') }}
restore-keys: |
${{ runner.os }}-arch-cross-${{ matrix.target }}-
${{ runner.os }}-arch-cargo-x86_64-
- name: Build
env:
CROSS_CONFIG: Cross.arch.toml
run: |
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
cargo build --release --target ${{ matrix.target }}
else
cross build --release --target ${{ matrix.target }}
fi
run: cargo build --release --target x86_64-unknown-linux-gnu

- name: Prepare PKGBUILD
run: |
Expand All @@ -233,12 +200,12 @@ jobs:
cd pkg
mv ../modbus-relay.tar.gz .
cp /tmp/modbus-relay/dist/arch/PKGBUILD .
CARCH=${{ matrix.arch }} makepkg -s --noconfirm
CARCH=x86_64 makepkg -s --noconfirm
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pkg-${{ matrix.arch }}
name: pkg-x86_64
path: /tmp/pkg/*.pkg.tar.zst

create-release:
Expand Down

0 comments on commit e6b4dee

Please sign in to comment.