-
Notifications
You must be signed in to change notification settings - Fork 67
45 lines (38 loc) · 1.74 KB
/
publish-versioned-api-ref.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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@v4
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@v4
with:
repository: ${{ github.repository }}.wiki
path: wiki
- 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