From 39ae951aab014ece66c921b8827b78550e223fb2 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Thu, 25 Apr 2024 15:46:54 +0100 Subject: Release aarch64 build --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a3d484..5dc5533 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,40 +9,48 @@ jobs: release: strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - include: + platform: - os: ubuntu-latest + target: x86_64-unknown-linux-gnu bin: sentrum name: sentrum-${{ github.ref_name }}-linux-x86_64 + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + bin: sentrum + name: sentrum-${{ github.ref_name }}-linux-aarch64 - os: windows-latest + target: x86_64-pc-windows-msvc bin: sentrum.exe name: sentrum-${{ github.ref_name }}-windows-x86_64 - os: macos-latest + target: x86_64-apple-darwin bin: sentrum name: sentrum-${{ github.ref_name }}-darwin-x86_64 - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.platform.os }} steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - uses: Swatinem/rust-cache@v2 - - run: cargo build --locked --release + - name: Build binary + uses: houseabsolute/actions-rust-cross@v0 + with: + target: ${{ matrix.platform.target }} + args: "--locked --release" + strip: true - name: Package shell: bash run: | - strip target/release/${{ matrix.bin }} - mkdir ${{ matrix.name }} - cp target/release/${{ matrix.bin }} ${{ matrix.name }} - cp sentrum.sample.toml ${{ matrix.name }} - cp -r contrib ${{ matrix.name }} - cp -r man ${{ matrix.name }} - cp LICENSE.txt ${{ matrix.name }} - if [[ "${{ matrix.os }}" == "windows-latest" ]] + mkdir ${{ matrix.platform.name }} + cp target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin }} ${{ matrix.platform.name }} + cp sentrum.sample.toml ${{ matrix.platform.name }} + cp -r contrib ${{ matrix.platform.name }} + cp -r man ${{ matrix.platform.name }} + cp LICENSE.txt ${{ matrix.platform.name }} + cp README.md ${{ matrix.platform.name }} + if [[ "${{ matrix.platform.os }}" == "windows-latest" ]] then - 7z a ${{ matrix.name }}.zip ${{ matrix.name }} + 7z a ${{ matrix.platform.name }}.zip ${{ matrix.platform.name }} else - tar czvf ${{ matrix.name }}.tar.gz ${{ matrix.name }} + tar czvf ${{ matrix.platform.name }}.tar.gz ${{ matrix.platform.name }} fi - name: Generate Changelog run: utils/generate_changelog.sh > ${{ github.workspace }}-CHANGELOG.md -- cgit v1.2.3-70-g09d2