Add build #1
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: build | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "*" | |
| jobs: | |
| rops-build-amd64: | |
| name: Build rops binary for amd64 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build rops binary | |
| run: cargo build --release | |
| - name: Upload artifact (binary) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rops-amd64- | |
| if-no-files-found: error | |
| path: target/release/rops | |
| rops-build-arm64: | |
| name: Build rops binary for arm64 | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install GCC for arm64 | |
| run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu | |
| - name: Build rops binary for arm64 | |
| run: rustup target add aarch64-unknown-linux-gnu && cargo build --release --target aarch64-unknown-linux-gnu | |
| - name: Upload artifact (binary for arm64) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rops-arm64- | |
| if-no-files-found: error | |
| path: rops/target/aarch64-unknown-linux-gnu/release/rops | |
| rops-release: | |
| name: Release rops binary | |
| needs: [rops-build-amd64, rops-build-arm64] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Rename artifacts | |
| run: | | |
| mv rops-amd64-/rops rops-amd64 | |
| mv rops-arm64-/rops rops-arm64 | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "rops-amd64,rops-arm64" |