Repository navigation
Use musl target for portable Linux ARM64 builds #4
Workflow file for this run
This file contains hidden or 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: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| name: ghui-macos-arm64 | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| name: ghui-linux-x64 | |
| - target: aarch64-unknown-linux-musl | |
| os: ubuntu-latest | |
| name: ghui-linux-arm64 | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| name: ghui-windows-x64.exe | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.target }} | |
| - name: Install cross-compilation tools | |
| if: matrix.target == 'aarch64-unknown-linux-musl' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y musl-tools | |
| wget -q https://musl.cc/aarch64-linux-musl-cross.tgz | |
| tar xzf aarch64-linux-musl-cross.tgz | |
| echo "$PWD/aarch64-linux-musl-cross/bin" >> $GITHUB_PATH | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} | |
| env: | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER: aarch64-linux-musl-gcc | |
| - name: Rename binary (Unix) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| mv target/${{ matrix.target }}/release/ghui ${{ matrix.name }} | |
| - name: Rename binary (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| mv target/${{ matrix.target }}/release/ghui.exe ${{ matrix.name }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: ${{ matrix.name }} | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: artifacts/**/* | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |