From 43e5ee5288f93ce947419dcc55f97e70ecda7dfa Mon Sep 17 00:00:00 2001 From: ramin Date: Tue, 21 May 2024 12:46:20 +0100 Subject: [PATCH] ci: generate and store openrpc.json with the tagged release artifacts (#3350) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a step in the ci_and_release pipeline to generate `openrpc.json` using `make openrpc-gen` and store that generated file with the release artifacts. This is set to run after go-releaser, though we could have made this its own workflow file potentially. I have tested that release upload works in a personal repo, but as with all things on github, we can only REALLY test and do this one live 🤞 refs #2611 --- .github/workflows/ci_release.yml | 15 +++++++++++++++ Makefile | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml index 9eac02231d..67aeffd653 100644 --- a/.github/workflows/ci_release.yml +++ b/.github/workflows/ci_release.yml @@ -137,3 +137,18 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + + upload-docs: + needs: goreleaser + if: github.event_name == 'release' + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - run: | + make openrpc-gen > openrpc.json + gh release upload ${{github.event.release.tag_name}} openrpc.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index 32f2a640f4..c05c777f03 100644 --- a/Makefile +++ b/Makefile @@ -175,7 +175,6 @@ pb-gen: ## openrpc-gen: Generate OpenRPC spec for Celestia-Node's RPC api openrpc-gen: - @echo "--> Generating OpenRPC spec" @go run ${LDFLAGS} ./cmd/celestia docgen .PHONY: openrpc-gen