code.vegaprotocol.io/vega@v0.79.0/.github/workflows/release-docs.yml (about) 1 --- 2 name: "Release Documentation" 3 4 "on": 5 push: 6 tags: 7 - '**' 8 9 workflow_dispatch: 10 inputs: 11 tag: 12 description: 'Git Tag to build and publish' 13 required: false 14 type: string 15 default: '' 16 17 jobs: 18 gen-docs: 19 runs-on: ubuntu-latest 20 steps: 21 - 22 name: Check out vega code 23 uses: actions/checkout@v3 24 with: 25 path: 'vega' 26 fetch-depth: '0' 27 ref: ${{ inputs.tag }} 28 - 29 name: Check out docs code 30 uses: actions/checkout@v3 31 with: 32 path: 'documentation' 33 repository: 'vegaprotocol/documentation' 34 fetch-depth: '0' 35 token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }} 36 - 37 name: Set up Go 38 uses: actions/setup-go@v2 39 with: 40 go-version: '1.21' 41 - 42 name: Get dependencies 43 run: cd vega; bash script/gettools.sh 44 - 45 name: Generate docs 46 run: cd vega; make proto_docs; echo "generated docs:"; find protos/generated -type f 47 - 48 name: Make PR to the docs repo 49 env: 50 GH_TOKEN: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }} 51 run: | 52 cd vega 53 ref="$(git describe --tags --abbrev=0)" 54 short_sha="$(git rev-parse --short HEAD)" 55 cd .. 56 mkdir -p "documentation/specs/${ref}" 57 mkdir -p "documentation/specs/${ref}/wallet/api" 58 cp -r vega/protos/generated/* "documentation/specs/${ref}/" 59 cp "vega/datanode/gateway/graphql/schema.graphql" "documentation/specs/${ref}/datanode-schema.graphql" 60 cp "vega/wallet/api/openrpc.json" "documentation/specs/${ref}/wallet/api/openrpc.json" 61 cp "vega/wallet/service/openapi.json" "documentation/specs/${ref}/wallet/api/wallet.openapi.json" 62 cd documentation 63 git config --global user.email "vega-ci-bot@vega.xyz" 64 git config --global user.name "vega-ci-bot" 65 branch_name="spec-update-${ref}-$(date '+%Y-%-m-%d-%H-%M')" 66 git checkout -b "$branch_name" 67 commit_msg="Automated specs update from vegaprotocol/vega#${short_sha}" 68 git add specs 69 git commit -m "$commit_msg" || exit 0 70 git push -u origin "$branch_name" 71 pr_url="$(gh pr create --title "${commit_msg} to ${ref}" --body 'This is automated pull request that will be merged after pipeline passes' --reviewer vegaprotocol/docs)" 72 echo $pr_url 73 # once auto merge get's enabled on documentation repo let's do follow up 74 # sleep 5 75 # gh pr merge "${pr_url}" --auto --delete-branch --squash