From a81551ce678cc44b4be1f2bde0e3343f16bf7462 Mon Sep 17 00:00:00 2001 From: Jeet Burman Date: Sat, 27 Dec 2025 01:43:32 +0530 Subject: [PATCH] feat: enable workflow_dispatch for bump-meshery-version workflow - Add workflow_dispatch trigger with optional release_tag input - Fetch latest release tag when no input is provided via GitHub API - Strip 'v' prefix from release tags for npm compatibility - Maintain backward compatibility with workflow_run trigger - Add conditional steps for automated vs manual dispatch Fixes #790 Signed-off-by: Jeet Burman --- .github/workflows/bump-meshery-version.yml | 35 +++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bump-meshery-version.yml b/.github/workflows/bump-meshery-version.yml index 02a67d55..4979b456 100644 --- a/.github/workflows/bump-meshery-version.yml +++ b/.github/workflows/bump-meshery-version.yml @@ -5,6 +5,12 @@ on: workflows: [Publish Node.js Package] types: - completed + workflow_dispatch: + inputs: + release_tag: + description: 'Release tag version (e.g., v1.0.0). Leave empty to use latest release.' + required: false + type: string jobs: versions-check: @@ -12,16 +18,43 @@ jobs: outputs: current: ${{ steps.current.outputs.VERSION }} steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Download Version + if: github.event_name == 'workflow_run' uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: version-number github-token: ${{ secrets.GH_ACCESS_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - - name: Retrieve Version + - name: Retrieve Version (Automated Trigger) + if: github.event_name == 'workflow_run' run: | echo "VERSION=$(cat ./number)" >> $GITHUB_OUTPUT + id: current-automated + - name: Get Latest Release (Manual Trigger - No Input) + if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag == '' + id: latest-release + run: | + LATEST_TAG=$(curl -s https://api.github.com/repos/layer5io/sistent/releases/latest | jq -r '.tag_name') + echo "VERSION=${LATEST_TAG#v}" >> $GITHUB_OUTPUT + - name: Use Provided Release Tag (Manual Trigger - With Input) + if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '' + id: manual-release + run: | + echo "VERSION=${{ github.event.inputs.release_tag }}" >> $GITHUB_OUTPUT + - name: Set Final Version id: current + run: | + if [ "${{ github.event_name }}" == "workflow_run" ]; then + echo "VERSION=${{ steps.current-automated.outputs.VERSION }}" >> $GITHUB_OUTPUT + elif [ "${{ github.event.inputs.release_tag }}" != "" ]; then + echo "VERSION=${{ steps.manual-release.outputs.VERSION }}" >> $GITHUB_OUTPUT + else + echo "VERSION=${{ steps.latest-release.outputs.VERSION }}" >> $GITHUB_OUTPUT + fi bump-meshery: runs-on: ubuntu-latest needs: versions-check