From 0f89e966705ced85ae1a0c758fa10feb0e155765 Mon Sep 17 00:00:00 2001 From: demonsh Date: Wed, 11 Dec 2024 13:54:17 +0000 Subject: [PATCH] Add Maven publishing workflow (#1) * Change SonatypeHost to S01 * Initial publish action --- .github/workflows/publish.yml | 40 ++++++++++++++++++++++++++++++ circomwitnesscalc/build.gradle.kts | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e42f526 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +name: Publish to Maven Central + +on: + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Setup Gradle Cache + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build and Publish Library + run: | + set -e # Exit on any error + ./gradlew clean build + ./gradlew publishReleasePublicationToMavenRepository --info + env: + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_KEY_PASSWORD }} \ No newline at end of file diff --git a/circomwitnesscalc/build.gradle.kts b/circomwitnesscalc/build.gradle.kts index b45baac..1982317 100644 --- a/circomwitnesscalc/build.gradle.kts +++ b/circomwitnesscalc/build.gradle.kts @@ -116,7 +116,7 @@ mavenPublishing { } } - publishToMavenCentral(SonatypeHost.DEFAULT) + publishToMavenCentral(SonatypeHost.S01) signAllPublications() }