From ec5c3ef073558f7c94eb8e21d778c1a9dbda3d08 Mon Sep 17 00:00:00 2001 From: "paul.intal" Date: Tue, 10 Feb 2026 15:59:43 -0800 Subject: [PATCH 1/3] chore: add manual publish workflow for Maven Central Add a manual-publish workflow as an escape hatch for publishing to Maven Central without going through semantic-release. Also add workflow_call trigger to the test workflow so it can be reused. --- .github/workflows/manual-publish.yml | 44 +++++++++++++++++++++++++ .github/workflows/pull-request-test.yml | 4 ++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/manual-publish.yml diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml new file mode 100644 index 0000000..244e91b --- /dev/null +++ b/.github/workflows/manual-publish.yml @@ -0,0 +1,44 @@ +name: Manual Publish and Release + +on: + workflow_dispatch: + +jobs: + authorize: + name: Authorize + runs-on: ubuntu-latest + steps: + - name: ${{ github.actor }} permission check to do a release + uses: "lannonbr/repo-permission-check-action@2.0.2" + with: + permission: "write" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + run-tests: + name: Run Tests + uses: ./.github/workflows/pull-request-test.yml + + release: + name: Release + runs-on: ubuntu-latest + needs: [authorize, run-tests] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'zulu' + + - name: Maven Central Publish and Release + run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache diff --git a/.github/workflows/pull-request-test.yml b/.github/workflows/pull-request-test.yml index 7b3a1a2..4e8a73b 100644 --- a/.github/workflows/pull-request-test.yml +++ b/.github/workflows/pull-request-test.yml @@ -1,6 +1,8 @@ name: Test -on: [pull_request] +on: + pull_request: + workflow_call: jobs: test: From 1eca353157e164b56a0ef9a6835fe976cc4dfa9c Mon Sep 17 00:00:00 2001 From: "paul.intal" Date: Tue, 10 Feb 2026 17:11:13 -0800 Subject: [PATCH 2/3] chore: add publish-only option to workflow --- .github/workflows/manual-publish.yml | 44 ---------------------------- .github/workflows/release.yml | 19 ++++++++---- 2 files changed, 14 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/manual-publish.yml diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml deleted file mode 100644 index 244e91b..0000000 --- a/.github/workflows/manual-publish.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Manual Publish and Release - -on: - workflow_dispatch: - -jobs: - authorize: - name: Authorize - runs-on: ubuntu-latest - steps: - - name: ${{ github.actor }} permission check to do a release - uses: "lannonbr/repo-permission-check-action@2.0.2" - with: - permission: "write" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run-tests: - name: Run Tests - uses: ./.github/workflows/pull-request-test.yml - - release: - name: Release - runs-on: ubuntu-latest - needs: [authorize, run-tests] - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }} - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} - ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up JDK 11 - uses: actions/setup-java@v4 - with: - java-version: '11' - distribution: 'zulu' - - - name: Maven Central Publish and Release - run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4286a2d..70d43bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,10 +3,15 @@ name: Release on: workflow_dispatch: inputs: - dryRun: - description: 'Do a dry run to preview instead of a real release' + mode: + type: choice + description: 'Release mode' + options: + - dry-run + - release + - publish-only required: true - default: 'true' + default: 'dry-run' jobs: authorize: @@ -54,7 +59,7 @@ jobs: run: ./gradlew test --info - name: Semantic Release --dry-run - if: ${{ github.event.inputs.dryRun == 'true'}} + if: ${{ github.event.inputs.mode == 'dry-run' }} run: | npx \ -p lodash \ @@ -66,7 +71,7 @@ jobs: semantic-release --dry-run - name: Semantic Release - if: ${{ github.event.inputs.dryRun == 'false'}} + if: ${{ github.event.inputs.mode == 'release' }} run: | npx \ -p lodash \ @@ -76,3 +81,7 @@ jobs: -p @google/semantic-release-replace-plugin@1.2.0 \ -p @semantic-release/exec@5 \ semantic-release + + - name: Publish to Maven Central + if: ${{ github.event.inputs.mode == 'publish-only' }} + run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache From 655a3da72eb2f0b9a6cf209824d5b0712152d2d5 Mon Sep 17 00:00:00 2001 From: "paul.intal" Date: Wed, 11 Feb 2026 11:19:51 -0800 Subject: [PATCH 3/3] use dryRun for consistency, add publish-only option --- .github/workflows/release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70d43bd..2e342d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,15 +3,15 @@ name: Release on: workflow_dispatch: inputs: - mode: + dryRun: type: choice - description: 'Release mode' + description: 'Do a dry run to preview instead of a real release [true/false/publish-only]' options: - - dry-run - - release + - 'true' + - 'false' - publish-only required: true - default: 'dry-run' + default: 'true' jobs: authorize: @@ -59,7 +59,7 @@ jobs: run: ./gradlew test --info - name: Semantic Release --dry-run - if: ${{ github.event.inputs.mode == 'dry-run' }} + if: ${{ github.event.inputs.dryRun == 'true' }} run: | npx \ -p lodash \ @@ -71,7 +71,7 @@ jobs: semantic-release --dry-run - name: Semantic Release - if: ${{ github.event.inputs.mode == 'release' }} + if: ${{ github.event.inputs.dryRun == 'false' }} run: | npx \ -p lodash \ @@ -83,5 +83,5 @@ jobs: semantic-release - name: Publish to Maven Central - if: ${{ github.event.inputs.mode == 'publish-only' }} + if: ${{ github.event.inputs.dryRun == 'publish-only' }} run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache