Skip to content

Commit ced83fc

Browse files
committed
Allow release retries after Maven Central publication
1 parent 8823ea2 commit ced83fc

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
name: Release
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
types: [closed]
67
branches:
78
- main
89

10+
concurrency:
11+
group: scratch-library-release
12+
cancel-in-progress: false
13+
914
jobs:
1015
validate:
11-
if: github.event.pull_request.merged == true
16+
if: github.event.pull_request.merged == true || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
1217
runs-on: ubuntu-latest
1318
steps:
1419
- uses: actions/checkout@v7
@@ -23,7 +28,7 @@ jobs:
2328

2429
release:
2530
needs: validate
26-
if: github.event.pull_request.merged == true # only run if PR was merged
31+
if: github.event.pull_request.merged == true || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
2732
runs-on: ubuntu-latest
2833

2934
permissions:
@@ -61,7 +66,9 @@ jobs:
6166
- name: Deploy to Maven Central (signed)
6267
run: |
6368
mvn --version
64-
mvn -B clean deploy -Pcentral -Dgpg.executable=gpg
69+
# A previous attempt may have published to Central before a later
70+
# catalog or GitHub upload failed. Reuse immutable published versions.
71+
mvn -B clean deploy -Pcentral -Dgpg.executable=gpg -DignorePublishedComponents=true -DwaitUntil=published
6572
env:
6673
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
6774
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

0 commit comments

Comments
 (0)