From 5a16279bb6bd6ed56c990be08144e4bc0559aeb8 Mon Sep 17 00:00:00 2001 From: Konboi Date: Thu, 7 Mar 2024 16:22:23 +0900 Subject: [PATCH 1/2] introduce tagpr --- .github/workflows/publish.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6e978294..c474f00b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,29 +2,38 @@ name: Publish on: push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - + branches: + - main jobs: - publish: + tagpr: + permissions: + actions: write + contents: write + pull-requests: write runs-on: ubuntu-latest - + outputs: + tag: ${{ steps.run-tagpr.outputs.tag }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: Songmu/tagpr@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + publish: + needs: tagpr + if: needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - name: Set up JDK 1.8 uses: actions/setup-java@v3 with: distribution: temurin java-version: 8 - - name: Test run: ./gradlew test - env: - OPENAI_TOKEN: ${{ secrets.OPENAI_TOKEN }} - - name: Publish - run: ./gradlew build publish --no-parallel + run: ./gradlew publishAllPublicationsToMavenCentralRepository env: ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} From 462d7aff60ed5b4637871fbfe9874e653b94b260 Mon Sep 17 00:00:00 2001 From: Konboi Date: Thu, 7 Mar 2024 16:22:49 +0900 Subject: [PATCH 2/2] fix indent --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7c921414..186df055 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ allprojects { plugins.withId("com.vanniktech.maven.publish") { mavenPublishing { // Want to publish to so1.oss.sonatype.org - publishToMavenCentral(SonatypeHost.S01,true) + publishToMavenCentral(SonatypeHost.S01, true) signAllPublications() } }