Skip to content

Commit b6473c2

Browse files
authored
Merge pull request layer5io#372 from jerensl/ci/cloud-release
ci(cloude-release): add repository workflow for cloud release
2 parents de83668 + 4c81b93 commit b6473c2

File tree

3 files changed

+51
-1
lines changed

3 files changed

+51
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish Meshery Cloud 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+
if: steps.meshery-cloud.outputs.current_tag != steps.meshery-cloud.outputs.release_tag
42+
uses: stefanzweifel/git-auto-commit-action@v5
43+
with:
44+
commit_message: "Release Notes Meshery Cloud version ${{ steps.meshery-cloud.outputs.release_tag }}"
45+
branch: master
46+
commit_options: "--signoff"
47+
file_pattern: 'pricing_data.json'
48+
commit_user_name: l5io
49+
commit_user_email: ci@layer5.io
50+
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>

build/meshery-cloud.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.0.0

meshery-cloud.version

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)