From b6a765481a9ddb64782f59c43fbe45c1b4d4e11f Mon Sep 17 00:00:00 2001 From: Mark Sinclair Date: Wed, 16 Nov 2022 11:43:17 +0000 Subject: [PATCH] GitHub Actions: add workflow to build network explorer api --- .github/workflows/network-explorer-api.yml | 53 ++++++++++++++++++++++ Makefile | 3 ++ 2 files changed, 56 insertions(+) create mode 100644 .github/workflows/network-explorer-api.yml diff --git a/.github/workflows/network-explorer-api.yml b/.github/workflows/network-explorer-api.yml new file mode 100644 index 0000000000..6464d32b96 --- /dev/null +++ b/.github/workflows/network-explorer-api.yml @@ -0,0 +1,53 @@ +name: CI for Network Explorer API + +on: + workflow_dispatch: + release: + types: [created] + +env: + NETWORK: mainnet + +jobs: + publish-nym: + strategy: + fail-fast: false + matrix: + platform: [ubuntu-latest] + + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v3 + + - name: Check the release tag starts with `nym-explorer-api-` + if: startsWith(github.ref, 'refs/tags/nym-explorer-api-') == false && github.event_name != 'workflow_dispatch' + uses: actions/github-script@v3 + with: + script: | + core.setFailed('Release tag did not start with nym-explorer-api-...') + + - name: Install Rust stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Build all explorer-api + uses: actions-rs/cargo@v1 + with: + command: build + args: --manifest-path explorer-api/Cargo.toml --workspace --release + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: my-artifact + path: | + target/release/explorer-api + retention-days: 30 + + - name: Upload to release based on tag name + uses: softprops/action-gh-release@v1 + if: github.event_name == 'release' + with: + files: | + target/release/explorer-api diff --git a/Makefile b/Makefile index 95d163a7ca..8f5aba2678 100644 --- a/Makefile +++ b/Makefile @@ -92,6 +92,9 @@ build-wallet: build-connect: cargo build --manifest-path nym-connect/Cargo.toml --workspace +build-explorer-api: + cargo build --manifest-path explorer-api/Cargo.toml --workspace + build-wasm-client: cargo build --manifest-path clients/webassembly/Cargo.toml --workspace --target wasm32-unknown-unknown