Nightly #5
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: Nightly | |
| on: | |
| push: | |
| tags: | |
| - nightly | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| remove-nightly-tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Remove existing nightly release | |
| run: | | |
| gh release delete nightly --cleanup-tag || true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build: | |
| name: Build ${{ matrix.build.NAME }} | |
| needs: remove-nightly-tag | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| - { | |
| NAME: x86_64-linux, | |
| TARGET: x86_64-unknown-linux-musl, | |
| } | |
| - { | |
| NAME: aarch64-linux, | |
| TARGET: aarch64-unknown-linux-musl, | |
| } | |
| - { | |
| NAME: riscv64-linux, | |
| TARGET: riscv64gc-unknown-linux-musl, | |
| } | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get version info | |
| id: version | |
| run: | | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| echo "version=nightly-${SHORT_SHA}" >> $GITHUB_OUTPUT | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends musl-tools b3sum | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: ${{ matrix.build.TARGET }} | |
| - name: Install cross-compilation tools | |
| uses: taiki-e/setup-cross-toolchain-action@v1 | |
| with: | |
| target: ${{ matrix.build.TARGET }} | |
| - name: Build | |
| run: | | |
| RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --locked --target ${{ matrix.build.TARGET }} | |
| - name: Prepare release artifacts | |
| run: | | |
| cp "target/${{ matrix.build.TARGET }}/release/sbuild" "sbuild-${{ matrix.build.NAME }}" | |
| b3sum "sbuild-${{ matrix.build.NAME }}" > "sbuild-${{ matrix.build.NAME }}.b3sum" | |
| - name: Publish to GitHub (nightly) | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: sbuild-${{ matrix.build.NAME }}* | |
| file_glob: true | |
| overwrite: true | |
| tag: nightly | |
| release_name: "${{ steps.version.outputs.version }}" | |
| prerelease: true |