Skip to content

Commit

Permalink
Fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielleHuisman committed Oct 16, 2024
1 parent 8f4931b commit 8d6c08a
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,38 +46,45 @@ jobs:
rustup component add llvm-tools-preview --toolchain stable
rustup component add rust-std-${{ matrix.target }} --toolchain stable
- name: Set up target (aarch64-unknown-linux-*)
if: ${{ startsWith(matrix.target, 'aarch64-unknown-linux-') }}
run: sudo apt update -y && sudo apt install -y gcc-aarch64-linux-gnu

- name: Set up target (*-musl)
if: ${{ endsWith(matrix.target, '-musl') }}
run: sudo apt update -y && sudo apt install -y musl-dev musl-tools

- name: Set up target (aarch64-unknown-linux-musl)
if: ${{ matrix.target == 'aarch64-unknown-linux-musl' }}
run: |
sudo apt update -y && sudo apt install -y gcc-aarch64-linux-gnu
echo CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=rust-lld >> $GITHUB_ENV
echo CC=aarch64-linux-gnu-gcc >> $GITHUB_ENV
- name: Install dependenies (*-linux-*)
if: ${{ contains(matrix.target, '-linux-') }}
run: sudo apt update -y && sudo apt install -y libssl-dev

- name: Build
run: cargo build --bins --locked --release --target ${{ matrix.target }}

- name: Archive (tar.gz)
if: ${{ !contains(matrix.os, 'windows') }}
if: ${{ !contains(matrix.target, '-windows-') }}
run: tar czf ../../${{ matrix.package }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ${{ matrix.package }}
working-directory: target/${{ matrix.target }}/release

- name: Archive (zip)
if: ${{ contains(matrix.os, 'windows') }}
if: ${{ contains(matrix.target, '-windows-') }}
run: 7z a ../../${{ matrix.package }}-${{ github.ref_name }}-${{ matrix.target }}.zip ${{ matrix.package }}.exe
working-directory: target/${{ matrix.target }}/release

- name: Upload release asset (tar.gz)
if: ${{ !contains(matrix.os, 'windows') }}
if: ${{ !contains(matrix.target, '-windows-') }}
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.package }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
files: target/${{ matrix.package }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz

- name: Upload release asset (zip)
if: ${{ contains(matrix.os, 'windows') }}
if: ${{ contains(matrix.target, '-windows-') }}
uses: softprops/action-gh-release@v2
with:
files: ${{ matrix.package }}-${{ github.ref_name }}-${{ matrix.target }}.zip
files: target/${{ matrix.package }}-${{ github.ref_name }}-${{ matrix.target }}.zip

0 comments on commit 8d6c08a

Please sign in to comment.