From 97d235fff2f60353cdcfe7d86a4a8a3f2c985a38 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Mon, 19 Aug 2024 11:37:57 +0900 Subject: [PATCH 1/2] Publish from GitHub Actions --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..00f83ecc --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish +on: + push: + tags: + - "v0.*" +jobs: + publish: + environment: + name: maven-central-and-ruby-gems + runs-on: ubuntu-latest + strategy: + fail-fast: true + steps: + - uses: actions/checkout@v4 + - name: Set up OpenJDK 8 + uses: actions/setup-java@v4 + with: + java-version: 8 + distribution: "temurin" + - name: Publish + run: | + mkdir -p $HOME/.gem + touch $HOME/.gem/credentials + chmod 0600 $HOME/.gem/credentials + printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials + ./gradlew --stacktrace publishMavenPublicationToMavenCentralRepository gemPush + env: + ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} + ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY_ARMOR }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }} + RUBYGEMS_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}" From 8286a2896f8beec4c65e12f0956f6f5306d2bac6 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Wed, 8 Jan 2025 15:43:40 +0900 Subject: [PATCH 2/2] Use `var` instead of `secrets` for OSSRH_USERNAME --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 00f83ecc..edd620ab 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,7 +25,7 @@ jobs: printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials ./gradlew --stacktrace publishMavenPublicationToMavenCentralRepository gemPush env: - ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} + ORG_GRADLE_PROJECT_ossrhUsername: ${{ vars.OSSRH_USERNAME }} ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY_ARMOR }} ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}