fix(ci): install bpf-linker in all workflows that build eBPF #2
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-release: | |
| name: Build Release Binaries | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| name: linux-x86_64 | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| name: linux-aarch64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchains | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rust-src | |
| - name: Install stable Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install bpf-linker | |
| run: cargo install bpf-linker | |
| - name: Install cross-compilation tools (aarch64) | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| . | |
| profile-bee-ebpf | |
| - name: Build eBPF | |
| run: cargo +nightly build --release -Z build-std=core --target bpfel-unknown-none --manifest-path profile-bee-ebpf/Cargo.toml | |
| - name: Build profile-bee (native) | |
| if: matrix.target == 'x86_64-unknown-linux-gnu' | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Build profile-bee (cross-compile aarch64) | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| env: | |
| CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Create tarball | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar -czf profile-bee-${{ matrix.name }}.tar.gz probee pbee | |
| mv profile-bee-${{ matrix.name }}.tar.gz ${{ github.workspace }}/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: profile-bee-${{ matrix.name }} | |
| path: profile-bee-${{ matrix.name }}.tar.gz | |
| create-release: | |
| name: Create GitHub Release | |
| needs: build-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Display structure of downloaded files | |
| run: ls -R artifacts | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| TAG_NAME="${{ github.ref_name }}" | |
| # Extract version and changelog for this release | |
| VERSION="${TAG_NAME#v}" | |
| # Create release with changelog | |
| gh release create "$TAG_NAME" \ | |
| --title "Release $TAG_NAME" \ | |
| --notes "See [CHANGELOG.md](https://github.com/zz85/profile-bee/blob/main/CHANGELOG.md) for details." \ | |
| artifacts/profile-bee-linux-x86_64/profile-bee-linux-x86_64.tar.gz \ | |
| artifacts/profile-bee-linux-aarch64/profile-bee-linux-aarch64.tar.gz |