diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 785ae9e4..9d80f28e 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -12,14 +12,41 @@ permissions: jobs: release-please: runs-on: ubuntu-latest + outputs: + release_created: ${{ steps.release.outputs.release_created }} + tag_name: ${{ steps.release.outputs.tag_name }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - + - uses: googleapis/release-please-action@v4 id: release with: config-file: release-please-config.json manifest-file: .release-please-manifest.json token: ${{ secrets.GITHUB_TOKEN }} + + trigger-maven-release: + needs: release-please + if: ${{ needs.release-please.outputs.release_created == 'true' }} + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - name: Trigger Maven Central publish + uses: actions/github-script@v7 + env: + TAG_NAME: ${{ needs.release-please.outputs.tag_name }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const tagName = process.env.TAG_NAME; + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'release.yml', + ref: 'main', + inputs: { tag_name: tagName } + }); + console.log(`Triggered Maven Central publish workflow for tag: ${tagName}`);