chore: fix linux arm64 build artifact publishing. (#27) #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- sprocket-v* | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Rust | |
run: rustup update stable && rustup default stable | |
- name: Update lock file | |
run: cargo update | |
- name: Publish to crates.io | |
run: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | |
- name: Create a GH release | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true | |
make_latest: true | |
build_artifacts: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- rust-target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
extension: tar.gz | |
- rust-target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
cross: true | |
extension: tar.gz | |
- rust-target: x86_64-apple-darwin | |
os: macos-latest | |
extension: tar.gz | |
- rust-target: aarch64-apple-darwin | |
os: macos-latest | |
extension: tar.gz | |
- rust-target: x86_64-pc-windows-gnu | |
os: windows-latest | |
extension: zip | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update Rust | |
run: rustup update stable && rustup default stable && rustup target add ${{ matrix.rust-target }} | |
- run: cargo build --release --target ${{ matrix.rust-target }} | |
if: ${{ ! matrix.cross }} | |
- run: sudo dpkg --add-architecture arm64 && sudo apt-get update && sudo apt-get install -y libssl-dev:arm64 | |
if: ${{ matrix.cross }} | |
- run: cargo install cross | |
if: ${{ matrix.cross }} | |
- run: cross build --release --target ${{ matrix.rust-target }} | |
if: ${{ matrix.cross }} | |
- run: tar -czvf sprocket-${{ matrix.rust-target }}.tar.gz -C ./target/${{ matrix.rust-target }}/release sprocket | |
if: matrix.os != 'windows-latest' | |
- run: cd ./target/${{ matrix.rust-target }}/release && 7z a sprocket-${{ matrix.rust-target }}.zip sprocket.exe | |
if: matrix.os == 'windows-latest' | |
- name: Update the GH release with the new artifact | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./target/${{ matrix.rust-target }}/release/sprocket-${{ matrix.rust-target }}.${{ matrix.extension }} |