Skip to content

feat(ci): enable workflow dispatch for Sistent package auto-bumper #1097

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions .github/workflows/bump-meshery-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,49 @@ on:
workflows: [Publish Node.js Package]
types:
- completed
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag to use (optional, uses latest release if not provided)'
required: false
type: string

jobs:
versions-check:
runs-on: ubuntu-latest
outputs:
current: ${{ steps.current.outputs.VERSION }}
steps:
- name: Download Version
- name: Download Version (workflow_run trigger)
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 from artifact (workflow_run trigger)
if: github.event_name == 'workflow_run'
run: |
echo "VERSION=$(cat ./number)" >> $GITHUB_OUTPUT
id: current_workflow_run
- name: Use provided tag or get latest release (workflow_dispatch trigger)
if: github.event_name == 'workflow_dispatch'
run: |
if [ -n "${{ github.event.inputs.release_tag }}" ]; then
echo "VERSION=${{ github.event.inputs.release_tag }}" >> $GITHUB_OUTPUT
else
# Get latest release tag from GitHub API
LATEST_TAG=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r .tag_name)
echo "VERSION=${LATEST_TAG}" >> $GITHUB_OUTPUT
fi
id: current_dispatch
- name: Set final version
run: |
if [ "${{ github.event_name }}" == "workflow_run" ]; then
echo "VERSION=${{ steps.current_workflow_run.outputs.VERSION }}" >> $GITHUB_OUTPUT
else
echo "VERSION=${{ steps.current_dispatch.outputs.VERSION }}" >> $GITHUB_OUTPUT
fi
id: current
bump-meshery:
runs-on: ubuntu-latest
Expand Down