Skip to content

Update CHANGELOG with latest changes (#6349) #21

Update CHANGELOG with latest changes (#6349)

Update CHANGELOG with latest changes (#6349) #21

Workflow file for this run

name: Build and Push Swagger-UI
env:
go-version: "1.22"
on:
# Allow manually triggering this workflow
workflow_dispatch:
push:
tags:
- '*'
jobs:
check-version:
runs-on: ubuntu-22.04
outputs:
go-sm-api-version: ${{ steps.go-sm-api-version.outputs.GO_SM_API_VERSION }}
steps:
- name: Checkout target repository on last release
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
check-latest: true
go-version: ${{ env.go-version }}
- name: Extract dependency version
id: go-sm-api-version
run: |
version=$(go list -m 'github.com/spacemeshos/api/release/go' | awk '{print $2}')
echo "GO_SM_API_VERSION=$version" > $GITHUB_OUTPUT
deploy:
runs-on: ubuntu-22.04
needs: check-version
steps:
- uses: actions/checkout@v4
with:
repository: spacemeshos/api
path: api
fetch-depth: 0
ref: 'refs/tags/${{ needs.check-version.outputs.go-sm-api-version }}'
- name: upload to testnet
run: >
aws s3 sync api/release/openapi/swagger/src
s3://${{ secrets.CLOUDFLARE_TESTNET_API_BUCKET }}/${{ github.ref_name }}
--endpoint-url https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com
--acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
- name: update url json file for testnet
working-directory: api/release/openapi/swagger/src
run: |
mkdir spec && cd spec
curl -o spec_urls.json https://testnet-api-docs.spacemesh.network/spec_urls.json
new_url="{\"url\":\"https://testnet-api-docs.spacemesh.network/${{ github.ref_name }}/api.swagger.json\",\"name\":\"${{ github.ref_name }}\"}"
jq ". += [$new_url]" spec_urls.json > tmp.json && mv tmp.json spec_urls.json
- name: upload new testnet json file
run: >
aws s3 sync api/release/openapi/swagger/src/spec
s3://${{ secrets.CLOUDFLARE_TESTNET_API_BUCKET }}
--endpoint-url https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com
--acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1