Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: Release

on:
workflow_dispatch:
pull_request:
types: [closed]
branches:
- main

concurrency:
group: scratch-library-release
cancel-in-progress: false

jobs:
validate:
if: github.event.pull_request.merged == true
if: github.event.pull_request.merged == true || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Expand All @@ -23,7 +28,7 @@ jobs:

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

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