Skip to content

Commit

Permalink
chore: add manual release GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
ttypic committed Dec 10, 2024
1 parent 64d51f7 commit 06cf9b7
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Manual Release to Maven Central

on:
workflow_dispatch:

jobs:
run-on-release:
runs-on: ubuntu-latest

steps:
# Ensure the workflow is being run for a published release
- name: Validate Release
run: |
if [ -z "${{ github.event.release.tag_name }}" ]; then
echo "This workflow must be run in the context of a published release.";
exit 1;
fi
echo "Running workflow for release: ${{ github.event.release.tag_name }}";
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

- name: Publish and release to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

0 comments on commit 06cf9b7

Please sign in to comment.