Skip to content

Commit 42d2218

Browse files
committed
ci(cloud-release): change to using workflow dispatch
Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com>
1 parent 104e51a commit 42d2218

File tree

2 files changed

+49
-94
lines changed

2 files changed

+49
-94
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish Version Dispatcher
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
release_notes_docs_cloud_latest:
7+
name: Release notes cloud with latest version
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
with:
13+
token: ${{ secrets.RELEASEDRAFTER_PAT }}
14+
repository: layer5io/docs
15+
- name: Get Latest Meshery Cloud Release
16+
id: meshery-cloud
17+
env:
18+
ACCESS_TOKEN: ${{ secrets.RELEASEDRAFTER_PAT }}
19+
run: |
20+
release_tag=$(curl -sL -H "Authorization: token $ACCESS_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/layer5io/meshery-cloud/releases/latest | jq -r ".tag_name")
21+
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT
22+
current_tag=$(<build/meshery-cloud.version)
23+
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT
24+
- name: Get Release Info
25+
if: steps.meshery-cloud.outputs.current_tag != steps.meshery-cloud.outputs.release_tag
26+
env:
27+
ACCESS_TOKEN: ${{ secrets.RELEASEDRAFTER_PAT }}
28+
run: |
29+
curl -sL -H "Authorization: token $ACCESS_TOKEN" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/layer5io/meshery-cloud/releases/latest > latest_release.json
30+
31+
export RELEASE_TAG=$( cat latest_release.json | jq '.["tag_name"]' | tr -d '"')
32+
export PRERELEASE=$( cat latest_release.json | jq '.["prerelease"]' | tr -d '"')
33+
export RELEASE_BODY=$( cat latest_release.json | jq '.["body"]' | tr -d '"')
34+
export DATE=$( cat latest_release.json | jq '.["published_at"]' | tr -d '"')
35+
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
36+
- name: Update current release version
37+
if: steps.meshery-cloud.outputs.current_tag != steps.meshery-cloud.outputs.release_tag
38+
run: |
39+
echo ${{ steps.meshery-cloud.outputs.release_tag }} > build/meshery-cloud.version
40+
- name: Commit changes
41+
uses: stefanzweifel/git-auto-commit-action@v5
42+
with:
43+
commit_message: "Release Notes Meshery Cloud version ${{ steps.meshery-cloud.outputs.release_tag }}"
44+
branch: master
45+
commit_options: "--signoff"
46+
file_pattern: 'pricing_data.json'
47+
commit_user_name: l5io
48+
commit_user_email: ci@layer5.io
49+
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>

.github/workflows/release-docs.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)