diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml new file mode 100644 index 0000000..f407329 --- /dev/null +++ b/.github/workflows/build-binaries.yml @@ -0,0 +1,50 @@ +name: Build Binaries + +on: + workflow_dispatch: + push: + branches: + - main + tags: + - "*" + pull_request: + +jobs: + build: + name: Build (${{ matrix.target }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: + - x86_64-unknown-linux-gnu + - aarch64-unknown-linux-gnu + - x86_64-unknown-linux-musl + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Install cross + uses: taiki-e/install-action@v2 + with: + tool: cross + + - name: Build release binary + run: cross build --release --bin mqattack --target ${{ matrix.target }} + + - name: Prepare artifact + run: | + mkdir -p dist + cp target/${{ matrix.target }}/release/mqattack \ + dist/mqattack-${{ matrix.target }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: mqattack-${{ matrix.target }} + path: dist/mqattack-${{ matrix.target }} + if-no-files-found: error