Updates. #12
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: build Linux musl | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-unknown-linux-musl | |
| - name: Install musl | |
| run: sudo apt-get update && sudo apt-get install -y musl-tools | |
| - name: Get package name and version | |
| id: metadata | |
| run: | | |
| NAME=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].name') | |
| echo "name=$NAME" >> $GITHUB_OUTPUT | |
| VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Build release binary | |
| run: cargo build --release --target=x86_64-unknown-linux-musl | |
| - name: Upload binary | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ steps.metadata.outputs.name }}-v${{ steps.metadata.outputs.version }}-x86_64-unknown-linux-musl | |
| path: target/x86_64-unknown-linux-musl/release/${{ steps.metadata.outputs.name }} |