diff --git a/.github/workflows/bump-meshery-version.yml b/.github/workflows/bump-meshery-version.yml index ab48cd36..a7ef37dd 100644 --- a/.github/workflows/bump-meshery-version.yml +++ b/.github/workflows/bump-meshery-version.yml @@ -3,9 +3,36 @@ name: Bump Meshery, Meshery Extensions and Meshery Cloud on: release: types: [published] + workflow_dispatch: + inputs: + release_tag: + description: 'Release tag to bump to (defaults to latest if empty)' + required: false + type: string jobs: + get-release-tag: + runs-on: ubuntu-latest + outputs: + release_tag: ${{ steps.set_tag.outputs.tag }} + steps: + - name: Set release tag + id: set_tag + run: | + if [ -n "${{ github.event.release.tag_name }}" ]; then + # tag from release event + echo "tag=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT + elif [ -n "${{ inputs.release_tag }}" ]; then + # input tag in workflow dispatch + echo "tag=${{ github.event.inputs.release_tag }}" >> $GITHUB_OUTPUT + else + # Fetch latest published release tag + TAG=$(curl -L -s https://github.com/layer5io/sistent/releases/latest | grep -oP 'releases/tag/\K[^"]+' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -1) + echo "tag=${TAG}" >> $GITHUB_OUTPUT + fi + bump-meshery: + needs: get-release-tag runs-on: ubuntu-latest steps: - name: Checkout Meshery code @@ -27,22 +54,23 @@ jobs: uses: peter-evans/create-pull-request@v7 with: token: ${{ secrets.RELEASEDRAFTER_PAT }} - commit-message: Bump sistent ${{ github.event.release.tag_name }} dependencies + commit-message: Bump sistent ${{ needs.get-release-tag.outputs.release_tag }} dependencies committer: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> signoff: true branch: bump-sistent-bot delete-branch: true - title: '[Chore]: Bump ${{ github.event.release.name }}' + title: '[Chore]: Bump sistent ${{ needs.get-release-tag.outputs.release_tag }}' add-paths: | ui/package.json ui/package-lock.json body: | - Update to Sistent ${{ github.event.release.tag_name }} + Update to Sistent ${{ needs.get-release-tag.outputs.release_tag }} _This pull request has been auto-generated by [l5io](http://github.com/l5io)_ assignees: l5io draft: false + bump-meshery-extensions: runs-on: ubuntu-latest steps: