Skip to content

v4.6.0

v4.6.0 #40

Workflow file for this run

name: documentation
on:
release:
types: [published]
permissions:
contents: write
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
- name: Set up Go
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 #v6.0.0
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@81c65b7cd4de9b2570615ce3aad67a41de5b1a13 #2.11.2
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@5fc4efd1a4797ddb68ffd0714a238564e4cc0e6f #v4.0.0
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 }}"}'