Skip to content

Commit 698f956

Browse files
authored
fix: trigger Maven deploy from release-please via workflow_dispatch (#1981)
## Summary - Events created by `GITHUB_TOKEN` don't trigger other workflows, so the tag push and `release: published` events from release-please never triggered the deploy workflow - Replace `push: tags` / `release: published` triggers on `release.yml` with `workflow_dispatch` - Have release-please call `gh workflow run release.yml` after creating a release - Also serves as a manual fallback (`gh workflow run release.yml --ref v1.5.1`) ## Test plan - [ ] CI passes - [ ] After merge, manually dispatch deploy for v1.5.1 - [ ] On next release, deploy triggers automatically from release-please Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent b27d2d4 commit 698f956

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/release-please.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- main
88

99
permissions:
10+
actions: write
1011
contents: write
1112
issues: write
1213
pull-requests: write
@@ -22,3 +23,11 @@ jobs:
2223
token: ${{ secrets.GITHUB_TOKEN }}
2324
config-file: .github/config/release-please-config.json
2425
manifest-file: .github/config/.release-please-manifest.json
26+
27+
- name: Trigger deploy to Maven Central
28+
if: ${{ steps.release-please.outputs.releases_created == 'true' }}
29+
env:
30+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
run: >
32+
gh workflow run release.yml
33+
--ref ${{ steps.release-please.outputs.tag_name }}

.github/workflows/release.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
name: Deploy to Maven Central
33

44
on:
5-
push:
6-
tags:
7-
- "v*.*.*"
8-
release:
9-
types:
10-
- published
5+
workflow_dispatch: {}
116

127
jobs:
138
deploy:

0 commit comments

Comments
 (0)