ci(agent): fix release workflow — musl static, aarch64, protoc #13
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: Hades-agent | |
| on: | |
| push: | |
| tags: | |
| - agent-v* | |
| jobs: | |
| build: | |
| name: "Release agent / ${{ matrix.arch }}" | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: x86_64 | |
| runner: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| - arch: aarch64 | |
| runner: ubuntu-24.04-arm | |
| target: aarch64-unknown-linux-musl | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| agent/target | |
| key: build-${{ matrix.target }}-${{ hashFiles('agent/Cargo.lock') }} | |
| restore-keys: build-${{ matrix.target }}- | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/cargo-deb | |
| ~/.cargo/bin/cargo-generate-rpm | |
| key: cargo-pkg-tools-${{ runner.os }}-${{ runner.arch }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y --no-install-recommends protobuf-compiler musl-tools | |
| - name: Install packaging tools | |
| run: | | |
| command -v cargo-deb || cargo install cargo-deb | |
| command -v cargo-generate-rpm || cargo install cargo-generate-rpm | |
| - name: Extract version from tag | |
| run: echo "BUILD_VERSION=${GITHUB_REF#refs/tags/agent-v}" >> $GITHUB_ENV | |
| - name: Build and package | |
| run: make -C agent package-musl TARGET=${{ matrix.target }} | |
| - name: Upload .deb | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hades-agent-deb-${{ matrix.arch }} | |
| path: /tmp/hades-agent_*.deb | |
| retention-days: 7 | |
| - name: Upload .rpm | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hades-agent-rpm-${{ matrix.arch }} | |
| path: /tmp/hades-agent-*.rpm | |
| retention-days: 7 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: /tmp/packages | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| prerelease: false | |
| name: Release ${{ github.ref_name }} | |
| files: /tmp/packages/**/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |