generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 83
50 lines (48 loc) · 2.85 KB
/
meshery-extension-release-docs.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
46
47
48
49
50
name: Publish Meshery Extensions Version Dispatcher
on:
workflow_dispatch:
jobs:
release_notes_docs_meshery_extensions_latest:
name: Release notes meshery extensions with latest version
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.RELEASEDRAFTER_PAT }}
repository: layer5io/docs
- name: Get Latest Meshery Extensions Release
id: meshery-extensions
env:
ACCESS_TOKEN: ${{ secrets.RELEASEDRAFTER_PAT }}
run: |
release_tag=$(curl -sL -H "Authorization: token $ACCESS_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/layer5labs/meshery-extensions-packages/releases/latest | jq -r ".tag_name")
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT
current_tag=$(<build/meshery-extensions.version)
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT
- name: Get Release Info
if: steps.meshery-extensions.outputs.current_tag != steps.meshery-extensions.outputs.release_tag
env:
ACCESS_TOKEN: ${{ secrets.RELEASEDRAFTER_PAT }}
run: |
curl -sL -H "Authorization: token $ACCESS_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/layer5labs/meshery-extensions-packages/releases/latest > latest_release.json
export RELEASE_TAG=$( cat latest_release.json | jq '.["tag_name"]' | tr -d '"')
export PRERELEASE=$( cat latest_release.json | jq '.["prerelease"]' | tr -d '"')
export RELEASE_BODY=$( cat latest_release.json | jq '.["body"]' | tr -d '"')
export DATE=$( cat latest_release.json | jq '.["published_at"]' | tr -d '"')
printf '%b\n' "---\ntitle: $RELEASE_TAG\ndate: $DATE\ntag: $RELEASE_TAG\nprerelease: $PRERELEASE\n---\n\n$RELEASE_BODY" > ./content/en/cloud/reference/releases/$RELEASE_TAG.md
- name: Update current release version
if: steps.meshery-extensions.outputs.current_tag != steps.meshery-extensions.outputs.release_tag
run: |
echo ${{ steps.meshery-extensions.outputs.release_tag }} > build/meshery-extensions.version
- name: Commit changes
if: steps.meshery-extensions.outputs.current_tag != steps.meshery-extensions.outputs.release_tag
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Release Notes Meshery Extension version ${{ steps.meshery-extensions.outputs.release_tag }}"
branch: master
commit_options: "--signoff"
file_pattern: 'build/meshery-extensions.version ./content/en/kanvas/reference/releases/${{ steps.meshery-extensions.outputs.release_tag }}.md'
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>