diff --git a/.github/workflows/cherry-pick-to-release.yml b/.github/workflows/cherry-pick-to-release.yml index f78fc49..ea3cf33 100644 --- a/.github/workflows/cherry-pick-to-release.yml +++ b/.github/workflows/cherry-pick-to-release.yml @@ -14,6 +14,7 @@ on: permissions: contents: write + actions: write jobs: cherry-pick: @@ -38,4 +39,12 @@ jobs: run: | git push origin release/v${{ inputs.version }} echo "Successfully cherry-picked commit to release/v${{ inputs.version }}" - echo "Release-please will update the CHANGELOG PR automatically." + + - name: Trigger Release Please + env: + GH_TOKEN: ${{ github.token }} + run: | + gh workflow run release-please.yml \ + --repo ${{ github.repository }} \ + -f version=${{ inputs.version }} + echo "Triggered Release Please workflow for version ${{ inputs.version }}" diff --git a/.github/workflows/cut-release-branch.yml b/.github/workflows/cut-release-branch.yml index 8908cd1..4f3eba3 100644 --- a/.github/workflows/cut-release-branch.yml +++ b/.github/workflows/cut-release-branch.yml @@ -14,6 +14,7 @@ on: permissions: contents: write + actions: write jobs: cut-branch: @@ -58,3 +59,12 @@ jobs: git commit -m "$COMMIT_MSG" git push origin "release/v${{ inputs.version }}" + + - name: Trigger Release Please + env: + GH_TOKEN: ${{ github.token }} + run: | + gh workflow run release-please.yml \ + --repo ${{ github.repository }} \ + -f version=${{ inputs.version }} + echo "Triggered Release Please workflow for version ${{ inputs.version }}" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index ae28585..a9aae82 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -4,6 +4,12 @@ on: push: branches: - 'release/**' + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g., 0.3.0)' + required: true + type: string permissions: contents: write @@ -13,18 +19,24 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - name: Extract version from branch name - id: extract-version + - name: Determine version + id: version run: | - # Branch name is like "release/v0.3.0", extract "0.3.0" - VERSION="${GITHUB_REF_NAME#release/v}" + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + VERSION="${{ inputs.version }}" + BRANCH="release/v${{ inputs.version }}" + else + VERSION="${GITHUB_REF_NAME#release/v}" + BRANCH="${GITHUB_REF_NAME}" + fi echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Extracted version: $VERSION" + echo "branch=$BRANCH" >> $GITHUB_OUTPUT + echo "Version: $VERSION, Branch: $BRANCH" - uses: googleapis/release-please-action@v4 id: release with: config-file: .github/release-please-config.json manifest-file: .github/.release-please-manifest.json - target-branch: ${{ github.ref_name }} - release-as: ${{ steps.extract-version.outputs.version }} + target-branch: ${{ steps.version.outputs.branch }} + release-as: ${{ steps.version.outputs.version }}