Skip to content

Merge pull request #1055 from rabbitmq/dependabot/github_actions/gith… #54

Merge pull request #1055 from rabbitmq/dependabot/github_actions/gith…

Merge pull request #1055 from rabbitmq/dependabot/github_actions/gith… #54

name: "Publish Versioned API Reference Wiki page"
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
publish-versioned-api-reference:
name: Publish Versioned API Reference Wiki
runs-on: ubuntu-latest
steps:
- name: Checkout operator codebase
uses: actions/checkout@v5
with:
path: messaging-topology-operator
- name: Get the version
id: get_version
run: echo VERSION="${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Checkout wiki codebase
uses: actions/checkout@v5
with:
repository: ${{ github.repository }}.wiki
path: wiki
- uses: actions/setup-go@v6
name: Install Go
with:
go-version-file: messaging-topology-operator/go.mod
- name: Generate API reference
run: make -C messaging-topology-operator api-reference
- name: Push to wiki
# User and email as documented here: https://github.com/marketplace/actions/checkout#push-a-commit-using-the-built-in-token
run: |
cd wiki
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# Add the versioned API Reference to the Wiki
cp ../messaging-topology-operator/docs/api/rabbitmq.com.ref.asciidoc ./API_Reference_${{ steps.get_version.outputs.VERSION }}.asciidoc
# Regenerate the ordered list of API Reference docs for the sidebar
export REGENERATED_SIDEBAR="$(../messaging-topology-operator/hack/generate-ordered-api-reference-list.sh .)"
echo "$REGENERATED_SIDEBAR" > Wiki_Sidebar.md
git add ./API_Reference_${{ steps.get_version.outputs.VERSION }}.asciidoc
git add ./Wiki_Sidebar.md
git commit -m "Publish version ${{ steps.get_version.outputs.VERSION }} API Reference"
git push