v0.2.16 #130
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: ["*"] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| REGISTRY: frknorg | |
| API_IMAGE_NAME: pony-api | |
| DOCKER_TAG: latest | |
| jobs: | |
| build-agent: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| target: | |
| - x86_64-unknown-linux-gnu | |
| - aarch64-unknown-linux-gnu | |
| - armv7-unknown-linux-gnueabihf | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install latest rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| default: true | |
| override: true | |
| - name: Update apt package index | |
| run: sudo apt-get update | |
| - name: Install protobuf-compiler | |
| run: sudo apt-get install -y protobuf-compiler | |
| - name: Install zig | |
| run: pip3 install ziglang | |
| - name: Install cargo-zigbuild | |
| run: cargo install --locked cargo-zigbuild | |
| - name: Add target | |
| run: rustup target add ${{ matrix.target }} | |
| - name: Build for ${{ matrix.target }} | |
| run: cargo zigbuild --release --target ${{ matrix.target }} --bin agent --no-default-features | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: agent-${{ matrix.target }} | |
| path: target/${{ matrix.target }}/release/agent | |
| build-api: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install latest rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| default: true | |
| override: true | |
| - name: Update apt package index | |
| run: sudo apt-get update | |
| - name: Install protobuf-compiler | |
| run: sudo apt-get install -y protobuf-compiler | |
| - name: Build | |
| run: cargo build --release --no-default-features --bin api | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: api | |
| path: target/release/api | |
| build-auth: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install latest rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: nightly | |
| default: true | |
| override: true | |
| - name: Update apt package index | |
| run: sudo apt-get update | |
| - name: Install protobuf-compiler | |
| run: sudo apt-get install -y protobuf-compiler | |
| - name: Build | |
| run: cargo build --release --no-default-features --bin auth | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: auth | |
| path: target/release/auth | |
| release: | |
| name: Release | |
| needs: [build-api, build-agent, build-auth] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download all agent artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| pattern: agent-* | |
| merge-multiple: false | |
| - name: Download API artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: api | |
| path: artifacts/api | |
| - name: Download Auth artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: auth | |
| path: artifacts/auth | |
| - name: Prepare release files | |
| run: | | |
| mkdir -p release | |
| cp artifacts/agent-x86_64-unknown-linux-gnu/agent release/agent-x86_64 | |
| cp artifacts/agent-aarch64-unknown-linux-gnu/agent release/agent-aarch64 | |
| cp artifacts/agent-armv7-unknown-linux-gnueabihf/agent release/agent-armv7 | |
| cp artifacts/api/api release/api-x86_64 | |
| cp artifacts/auth/auth release/auth-x86_64 | |
| chmod +x release/* | |
| - name: Release | |
| uses: softprops/action-gh-release@v1 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: | | |
| release/api-x86_64 | |
| release/auth-x86_64 | |
| release/agent-x86_64 | |
| release/agent-aarch64 | |
| release/agent-armv7 | |
| docs/* | |
| README.md | |
| config-agent-example.toml | |
| config-api-example.toml | |
| config-auth-example.toml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |