From 6b77fa93dc90f68cb28c617c4c4408f388da0805 Mon Sep 17 00:00:00 2001 From: jerensl <54782057+jerensl@users.noreply.github.com> Date: Wed, 2 Oct 2024 19:45:38 +0800 Subject: [PATCH] docs(meshery-extensions-release): add release notes ci and reference pages for extensions Signed-off-by: jerensl <54782057+jerensl@users.noreply.github.com> --- .../meshery-extension-release-docs.yml | 50 +++++++++++++++++++ build/meshery-extensions.version | 1 + .../en/kanvas/reference/releases/_index.md | 8 +++ 3 files changed, 59 insertions(+) create mode 100644 .github/workflows/meshery-extension-release-docs.yml create mode 100644 build/meshery-extensions.version create mode 100644 content/en/kanvas/reference/releases/_index.md diff --git a/.github/workflows/meshery-extension-release-docs.yml b/.github/workflows/meshery-extension-release-docs.yml new file mode 100644 index 00000000..a54d84ce --- /dev/null +++ b/.github/workflows/meshery-extension-release-docs.yml @@ -0,0 +1,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/releases/latest | jq -r ".tag_name") + echo "release_tag=$release_tag" >> $GITHUB_OUTPUT + 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/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: ci@layer5.io + commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> \ No newline at end of file diff --git a/build/meshery-extensions.version b/build/meshery-extensions.version new file mode 100644 index 00000000..60453e69 --- /dev/null +++ b/build/meshery-extensions.version @@ -0,0 +1 @@ +v1.0.0 \ No newline at end of file diff --git a/content/en/kanvas/reference/releases/_index.md b/content/en/kanvas/reference/releases/_index.md new file mode 100644 index 00000000..76017f94 --- /dev/null +++ b/content/en/kanvas/reference/releases/_index.md @@ -0,0 +1,8 @@ +--- +title: Releases +description: Release version of Meshery Extensions. +weight: 20 +categories: [Reference] +tags: [docs] +type: release +--- \ No newline at end of file