From 6b56937a77a8c1dc8854ecc8ad31503f4cb429bb Mon Sep 17 00:00:00 2001 From: Kennedy Kori Date: Mon, 22 Jan 2024 22:29:13 +0300 Subject: [PATCH] ci: decouple making a release and publishing Since it is not possible to pass environment variables to process spawned by the [semantic-release-exec-plugin](https://github.com/semantic-release/exec), move publishing artifacts into an seperate process that runs after a release is made. For more details regarding this issue, see [here](https://github.com/semantic-release/exec/issues/160). --- .github/workflows/ci.yml | 7 ++++++- .releaserc.yml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 654ec0e..79f2a0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,6 @@ jobs: run: npm ci - name: Create a release - run: npx semantic-release env: DEBUG: "semantic-release:*" GIT_AUTHOR_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} @@ -102,6 +101,11 @@ jobs: GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + run: npx semantic-release + + - name: Publish to all repositories + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} ORG_GRADLE_PROJECT_github.token: ${{ secrets.GH_TOKEN }} ORG_GRADLE_PROJECT_github.username: kennedykori ORG_GRADLE_PROJECT_signing.inMemory: "true" @@ -109,3 +113,4 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GRADLE_SIGNING_PASSWORD }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} + run: ./gradlew publish findSonatypeStagingRepository closeAndReleaseSonatypeStagingRepository diff --git a/.releaserc.yml b/.releaserc.yml index 2007b4c..43bc9ed 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -50,7 +50,7 @@ plugins: - - "@semantic-release/changelog" - changelogFile: "docs/CHANGELOG.md" - - "@semantic-release/exec" - - publishCmd: "./gradlew publish findSonatypeStagingRepository closeAndReleaseSonatypeStagingRepository" + - publishCmd: "./gradlew jar javadocJar sourcesJar" - - "@semantic-release/git" - assets: - docs/CHANGELOG.md