Skip to content

Commit

Permalink
update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shshemi committed Aug 20, 2024
1 parent 562727e commit 86426f4
Showing 1 changed file with 44 additions and 12 deletions.
56 changes: 44 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,38 +45,70 @@ jobs:
files: "tw-x86-linux-gnu;./target/debian/*.deb;./target/generate-rpm/*.rpm"
repo-token: ${{ secrets.GITHUB_TOKEN }}

build-and-upload-linux-arm-v6-v7-v8:
build-and-upload-linux-arm-v7:

runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'v')
strategy:
matrix:
os: [ubuntu-latest]
target: [arm-unknown-linux-gnueabihf, armv7-unknown-linux-gnueabihf, aarch64-unknown-linux-gnu]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout to the latest version
uses: actions/checkout@v4

- name: Install GCC
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential libzstd-dev gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu
- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential libzstd-dev gcc-arm-linux-gnueabihf libc6-dev-armhf-cross

- name: Set linker
run: export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc

- name: Install Rust
run: rustup target add ${{ matrix.target }}
run: rustup target add armv7-unknown-linux-gnueabihf

- name: Build
run: cargo build --release --verbose --target ${{ matrix.target }}
run: cargo build --release --verbose --target armv7-unknown-linux-gnueabihf

- name: Test
run: cargo test --all --release

- name: Rename before upload
run: mv target/${{ matrix.target }}/release/tw.exe tw-${{matrix.target}}.exe
run: mv target/armv7-unknown-linux-gnueabihf/release/tw tw-armv7-unknown-linux-gnueabihf

- name: Upload artifacts to release
uses: AButler/[email protected]
with:
files: tw-${{matrix.target}}.exe
files: tw-armv7-unknown-linux-gnueabihf
repo-token: ${{ secrets.GITHUB_TOKEN }}

build-and-upload-linux-aarch64:

runs-on: ubuntu-latest
if: startsWith(github.event.release.tag_name, 'v')

steps:
- name: Checkout to the latest version
uses: actions/checkout@v4

- name: Install build tools
run: sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential libzstd-dev gcc-aarch64-linux-gnu libc6-dev-arm64-cross

- name: Set linker
run: export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc

- name: Install Rust
run: rustup target add aarch64-unknown-linux-gnu

- name: Build
run: cargo build --release --verbose --target aarch64-unknown-linux-gnu

- name: Test
run: cargo test --all --release

- name: Rename before upload
run: mv target/aarch64-unknown-linux-gnu/release/tw tw-aarch64-unknown-linux-gnu

- name: Upload artifacts to release
uses: AButler/[email protected]
with:
files: tw-aarch64-unknown-linux-gnu
repo-token: ${{ secrets.GITHUB_TOKEN }}

build-and-upload-windows:
Expand Down

0 comments on commit 86426f4

Please sign in to comment.