diff --git a/.github/workflows/github_release_docker.yml b/.github/workflows/github_release_docker.yml index 56c8504bfe..cd6a0f0466 100644 --- a/.github/workflows/github_release_docker.yml +++ b/.github/workflows/github_release_docker.yml @@ -14,13 +14,10 @@ jobs: - name: Install protoc run: | sudo apt-get update && sudo apt-get install -y protobuf-compiler - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - uses: actions-rs/cargo@v1 - with: - command: build - args: --release + - uses: dtolnay/rust-toolchain@stable + - name: Build binaries in release mode + run: | + cargo build --release - name: Archive production artifacts uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/publish_openrpc_document.yml b/.github/workflows/publish_openrpc_document.yml new file mode 100644 index 0000000000..f6825b5627 --- /dev/null +++ b/.github/workflows/publish_openrpc_document.yml @@ -0,0 +1,37 @@ +name: Publish OpenRPC document + +on: + push: + tags: + - 'v*' + +jobs: + build_release_binary_and_publish_document: + name: Build nimiq-rpc-schema with release flag + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Install protoc + run: | + sudo apt-get update && sudo apt-get install -y protobuf-compiler + - uses: dtolnay/rust-toolchain@stable + - name: Build binary in release mode + run: | + cargo build --release --bin nimiq-rpc-schema + - name: Get latest release + id: get_release + uses: bruceadams/get-release@v1.3.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run nimiq-rpc-schema and save JSON output + run: | + ./target/release/nimiq-rpc-schema -o ${{ steps.get_release.outputs.tag_name }} > openrpc-document.json + - name: Upload OpenRPC document to latest release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./openrpc-document.json + asset_name: openrpc-document.json + asset_content_type: application/json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file