|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
| 4 | + pull_request: |
| 5 | + |
4 | 6 | release: |
5 | 7 | types: [published] |
6 | 8 |
|
7 | 9 | permissions: {} |
8 | 10 |
|
9 | 11 | jobs: |
10 | | - llvm: |
11 | | - uses: ./.github/workflows/llvm.yml |
12 | | - |
13 | 12 | upload-bins: |
14 | | - # TODO: Build for macos someday. |
15 | | - runs-on: ubuntu-22.04 |
16 | | - needs: llvm |
| 13 | + runs-on: ${{ matrix.platform.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + platform: |
| 17 | + - os: macos-latest |
| 18 | + target: aarch64-apple-darwin |
| 19 | + - os: macos-15-intel |
| 20 | + target: x86_64-apple-darwin |
| 21 | + - os: ubuntu-22.04 |
| 22 | + target: x86_64-unknown-linux-musl |
| 23 | + extra-features: deps-link-static |
| 24 | + - os: ubuntu-22.04-arm |
| 25 | + target: aarch64-unknown-linux-musl |
| 26 | + extra-features: deps-link-static |
| 27 | + env: |
| 28 | + RUST_CI_LLVM_INSTALL_DIR: /tmp/rustc-llvm |
17 | 29 | steps: |
18 | | - - name: Restore LLVM |
19 | | - uses: actions/cache/restore@v4 |
20 | | - with: |
21 | | - path: llvm-install |
22 | | - key: ${{ needs.llvm.outputs.cache-key }} |
23 | | - fail-on-cache-miss: true |
24 | | - |
25 | | - - name: Add LLVM to PATH |
26 | | - run: | |
27 | | - echo "${{ github.workspace }}/llvm-install/bin" >> $GITHUB_PATH |
28 | | - echo "$PATH" |
29 | | -
|
30 | 30 | - uses: actions/checkout@v6 |
31 | 31 | - uses: Swatinem/rust-cache@v2 |
32 | 32 |
|
| 33 | + - name: Install LLVM from Rust CI |
| 34 | + run: | |
| 35 | + set -euxo pipefail |
| 36 | + sudo mkdir -p $RUST_CI_LLVM_INSTALL_DIR |
| 37 | + rustc_date="$(curl -s https://static.rust-lang.org/dist/channel-rust-nightly-date.txt)" |
| 38 | + rustc_sha="$(curl -s "https://static.rust-lang.org/dist/$rustc_date/channel-rust-nightly-git-commit-hash.txt")" |
| 39 | + wget -q -O - "https://ci-artifacts.rust-lang.org/rustc-builds/$rustc_sha/rust-dev-nightly-${{ matrix.platform.target }}.tar.xz" | \ |
| 40 | + sudo tar -xJ --strip-components 2 -C $RUST_CI_LLVM_INSTALL_DIR |
| 41 | + echo "${RUST_CI_LLVM_INSTALL_DIR}/bin" >> $GITHUB_PATH |
| 42 | +
|
33 | 43 | - uses: taiki-e/upload-rust-binary-action@v1 |
34 | 44 | with: |
35 | 45 | bin: bpf-linker |
36 | | - features: llvm-link-static |
| 46 | + features: llvm-21,llvm-link-static,${{ matrix.platform.extra-features }} |
| 47 | + no-default-features: true |
| 48 | + dry-run: ${{ github.event_name != 'release' }} |
37 | 49 | env: |
38 | 50 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 51 | + |
| 52 | + - name: Report disk usage |
| 53 | + if: ${{ always() }} |
| 54 | + uses: ./.github/actions/report-disk-usage |
0 commit comments