update archive IPNS and add support for non-existing archive accounts #182
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: API Swagger Docs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
api-swagger: | |
name: Generate vocdoni-api.yaml | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install swag | |
run: | | |
curl -L https://github.com/swaggo/swag/releases/download/v1.8.12/swag_1.8.12_Linux_x86_64.tar.gz | tar -xzf - | |
- name: Run swag | |
run: ./swag init --parseDependency --parseDepth 1 --parseInternal --md api/docs/descriptions --overridesFile api/docs/.swaggo -g api.go -d api/,api/docs/models/ -o api/docs --ot yaml | |
- name: Install api-spec-converter | |
run: npm install -g api-spec-converter | |
- name: Convert the Swagger file to OAS3 format | |
run: api-spec-converter --from=swagger_2 --to=openapi_3 --syntax=yaml api/docs/swagger.yaml > api/docs/oas3.yaml | |
- name: yq - portable yaml processor | |
uses: mikefarah/[email protected] | |
with: | |
cmd: | | |
yq '.components.schemas."api.GenericTransactionWithInfo".properties.tx = load("api/docs/models/transactions.yaml").target' \ | |
api/docs/oas3.yaml > api/docs/vocdoni-api.yaml | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vocdoni-api.yaml | |
path: api/docs/vocdoni-api.yaml | |
- name: Get short commit hash | |
id: vars | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Checkout developer-portal repo | |
uses: actions/checkout@v3 | |
with: | |
repository: vocdoni/developer-portal | |
ref: main | |
path: developer-portal | |
- name: Copy generated docs | |
run: cp -f ./api/docs/vocdoni-api.yaml ./developer-portal/swaggers/vocdoni-api.yaml | |
- name: Create PR to developer-portal repo | |
id: cpr | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.VOCDONIBOT_PAT }} | |
path: developer-portal | |
commit-message: "Update vocdoni-api docs by commit ${{ steps.vars.outputs.sha_short }}" | |
committer: "Arabot-1 <[email protected]>" | |
base: main | |
branch: update-api-docs | |
#branch-suffix: short-commit-hash ## creates temp update-sdk-docs-xyz branches | |
delete-branch: true ## true: delete branch after merging | |
title: Update docs with vocdoni-api repo changes | |
body: | | |
* This is an automated pull request to upload the updated vocdoni-api documentation. | |
* GitHub Action Run: [${{ github.run_id }}](https://github.com/vocdoni/vocdoni-node/actions/runs/${{ github.run_id }}) | |
labels: | | |
automated pr | |
reviewers: ${{ github.actor }} | |
team-reviewers: SdkDocsReviewer | |
- name: "Check PR: ${{ steps.cpr.outputs.pull-request-url }}" | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |