Bump actions/checkout from 4 to 5 (#10) #17
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: soarql | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| attestations: write | |
| contents: write | |
| id-token: write | |
| jobs: | |
| remove-nightly-tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Remove existing nightly tag | |
| run: | | |
| gh release delete nightly --cleanup-tag || true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| publish-nightly: | |
| name: Publish nightly binaries | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| - { | |
| NAME: aarch64-linux, | |
| TARGET: aarch64-unknown-linux-musl, | |
| } | |
| - { | |
| NAME: loongarch64-linux, | |
| TARGET: loongarch64-unknown-linux-musl | |
| } | |
| - { | |
| NAME: riscv64-linux, | |
| TARGET: riscv64gc-unknown-linux-musl | |
| } | |
| - { | |
| NAME: x86_64-linux, | |
| TARGET: x86_64-unknown-linux-musl, | |
| } | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Get version info | |
| id: version | |
| run: | | |
| SHORT_SHA=$(git rev-parse --short HEAD) | |
| echo "version=nightly-${SHORT_SHA}" >> $GITHUB_OUTPUT | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| sudo apt update -y | |
| sudo apt install b3sum findutils file -y | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: ${{ matrix.build.TARGET }} | |
| - name: Install Cross | |
| shell: bash | |
| run: | | |
| cargo install cross --git "https://github.com/cross-rs/cross" --jobs="$(($(nproc)+1))" | |
| hash -r &>/dev/null | |
| command -v cross &>/dev/null || { echo "cross command not found" >&2; exit 1; } | |
| - name: Build | |
| env: | |
| RUSTFLAGS: "-C target-feature=+crt-static \ | |
| -C link-self-contained=yes \ | |
| -C link-arg=-Wl,--build-id=none" | |
| run: cross +nightly build --release --locked --target "${{ matrix.build.TARGET }}" --jobs="$(($(nproc)+1))" --verbose | |
| - name: Prepare nightly binary | |
| env: | |
| ARTIFACT: "nightly/soarql-${{ matrix.build.NAME }}" | |
| shell: bash | |
| run: | | |
| mkdir -p nightly | |
| cp "target/${{ matrix.build.TARGET }}/release/soarql" "${ARTIFACT}" | |
| b3sum "${ARTIFACT}" > "${ARTIFACT}.b3sum" | |
| realpath "${ARTIFACT}" | xargs -I "{}" bash -c \ | |
| 'printf "\nFile: $(basename {})\n Type: $(file -b {})\n B3sum: $(b3sum {} | cut -d" " -f1)\n SHA256sum: $(sha256sum {} | cut -d" " -f1)\n Size: $(du -bh {} | cut -f1)\n"' | |
| - name: Upload nightly binary | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: nightly/* | |
| tag_name: nightly | |
| name: ${{ steps.version.outputs.version }} | |
| body: "This is an automated nightly build of soarql." | |
| prerelease: true | |
| draft: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Attest Build Provenance | |
| uses: actions/[email protected] | |
| with: | |
| subject-name: "soarql-${{ matrix.build.NAME }}" | |
| subject-path: | | |
| nightly/** | |
| show-summary: true | |
| continue-on-error: true |