v4.3.1 #32
Workflow file for this run
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: documentation | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
jobs: | |
documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Install swag by swaggo | |
run: | | |
go install github.com/swaggo/swag/cmd/swag@latest | |
- name: Run swag to initiate docs | |
run: | | |
swag init --dir=src/ | |
- name: Manipulate swagger.json with Release info | |
run: | | |
# set version of swagger.json to release name | |
contents="$(jq '.info.version = "${{ github.event.release.tag_name }}"' docs/swagger.json)" && \ | |
echo "${contents}" > docs/swagger.json | |
- name: Upload swagger.json to release page | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: docs/swagger.json | |
tag: ${{ github.ref }} | |
- name: Trigger workflow in tibiadata-api-docs repo | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
repository: TibiaData/tibiadata-api-docs | |
event-type: tibiadata-api-docs-release-update | |
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "tag_name": "${{ github.event.release.tag_name }}"}' |