Skip to content

Commit

Permalink
GH action for publishing OpenRPC document on new version and remove m…
Browse files Browse the repository at this point in the history
…ost actions-rs actions
  • Loading branch information
Eligioo committed May 2, 2024
1 parent 0c1839f commit 94e35d9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/github_release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/publish_openrpc_document.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}

0 comments on commit 94e35d9

Please sign in to comment.