|
| 1 | +--- |
| 2 | +name: Build/Release boil |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + paths: |
| 7 | + - '.github/workflows/boil_build_release.yaml' |
| 8 | + - 'rust-toolchain.toml' |
| 9 | + - 'Cargo.*' |
| 10 | + - '**.rs' |
| 11 | + push: |
| 12 | + tags: |
| 13 | + - "boil-[0-9]+.[0-9]+.[0-9]+**" |
| 14 | + |
| 15 | +env: |
| 16 | + RUST_VERSION: 1.87.0 |
| 17 | + |
| 18 | +jobs: |
| 19 | + # This job is always run to ensure we don't miss any new upstream advisories |
| 20 | + cargo-deny: |
| 21 | + name: Run cargo-deny |
| 22 | + runs-on: ubuntu-latest |
| 23 | + # Prevent sudden announcement of a new advisory from failing CI |
| 24 | + continue-on-error: ${{ matrix.checks == 'advisories' }} |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + checks: |
| 28 | + - advisories |
| 29 | + - bans licenses sources |
| 30 | + steps: |
| 31 | + - name: Checkout Repository |
| 32 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 33 | + with: |
| 34 | + persist-credentials: false |
| 35 | + submodules: recursive |
| 36 | + |
| 37 | + - name: Run cargo-deny |
| 38 | + uses: EmbarkStudios/cargo-deny-action@f2ba7abc2abebaf185c833c3961145a3c275caad # v2.0.13 |
| 39 | + with: |
| 40 | + command: check ${{ matrix.checks }} |
| 41 | + |
| 42 | + create-release: |
| 43 | + name: Create Draft Release |
| 44 | + if: github.event_name == 'push' |
| 45 | + needs: |
| 46 | + - cargo-deny |
| 47 | + runs-on: ubuntu-latest |
| 48 | + steps: |
| 49 | + - name: Create Draft Release |
| 50 | + uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2 |
| 51 | + with: |
| 52 | + draft: true |
| 53 | + |
| 54 | + build: |
| 55 | + name: Build boil |
| 56 | + needs: |
| 57 | + - cargo-deny |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + targets: |
| 62 | + - {target: aarch64-unknown-linux-gnu, os: ubuntu-24.04-arm} |
| 63 | + - {target: x86_64-unknown-linux-gnu, os: ubuntu-latest} |
| 64 | + - {target: aarch64-apple-darwin, os: macos-latest} |
| 65 | + runs-on: ${{ matrix.targets.os }} |
| 66 | + steps: |
| 67 | + - name: Checkout |
| 68 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 69 | + with: |
| 70 | + persist-credentials: false |
| 71 | + |
| 72 | + - uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 |
| 73 | + with: |
| 74 | + toolchain: ${{ env.RUST_VERSION }} |
| 75 | + targets: ${{ matrix.targets.target }} |
| 76 | + |
| 77 | + - name: Build Binary |
| 78 | + env: |
| 79 | + TARGET: ${{ matrix.targets.target }} |
| 80 | + run: cargo build --target "$TARGET" --release --package boil |
| 81 | + |
| 82 | + - name: Rename Binary |
| 83 | + env: |
| 84 | + TARGET: ${{ matrix.targets.target }} |
| 85 | + run: mv "target/$TARGET/release/boil" "boil-$TARGET" |
| 86 | + |
| 87 | + - name: Upload Artifact to Release |
| 88 | + if: github.event_name == 'push' |
| 89 | + uses: softprops/action-gh-release@72f2c25fcb47643c292f7107632f7a47c1df5cd8 # v2.3.2 |
| 90 | + with: |
| 91 | + draft: false |
| 92 | + files: boil-${{ matrix.targets.target }} |
0 commit comments