Skip to content

Commit

Permalink
Merge pull request #372 from jerensl/ci/cloud-release
Browse files Browse the repository at this point in the history
ci(cloude-release): add repository workflow for cloud release
  • Loading branch information
jerensl authored Sep 30, 2024
2 parents de83668 + 4c81b93 commit b6473c2
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/cloud-release-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Meshery Cloud Version Dispatcher
on:
workflow_dispatch:

jobs:
release_notes_docs_cloud_latest:
name: Release notes cloud 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 Cloud Release
id: meshery-cloud
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/layer5io/meshery-cloud/releases/latest | jq -r ".tag_name")
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT
current_tag=$(<build/meshery-cloud.version)
echo "current_tag=$current_tag" >> $GITHUB_OUTPUT
- name: Get Release Info
if: steps.meshery-cloud.outputs.current_tag != steps.meshery-cloud.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/layer5io/meshery-cloud/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-cloud.outputs.current_tag != steps.meshery-cloud.outputs.release_tag
run: |
echo ${{ steps.meshery-cloud.outputs.release_tag }} > build/meshery-cloud.version
- name: Commit changes
if: steps.meshery-cloud.outputs.current_tag != steps.meshery-cloud.outputs.release_tag
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Release Notes Meshery Cloud version ${{ steps.meshery-cloud.outputs.release_tag }}"
branch: master
commit_options: "--signoff"
file_pattern: 'pricing_data.json'
commit_user_name: l5io
commit_user_email: [email protected]
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
1 change: 1 addition & 0 deletions build/meshery-cloud.version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.0.0
1 change: 0 additions & 1 deletion meshery-cloud.version

This file was deleted.

0 comments on commit b6473c2

Please sign in to comment.