Skip to content

Commit

Permalink
ci: decouple making a release and publishing
Browse files Browse the repository at this point in the history
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](semantic-release/exec#160).
  • Loading branch information
kennedykori committed Jan 22, 2024
1 parent e32ca6b commit 6b56937
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,23 @@ jobs:
run: npm ci

- name: Create a release
run: npx semantic-release
env:
DEBUG: "semantic-release:*"
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_COMMITTER_NAME }}
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"
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GRADLE_SIGNING_KEY }}
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
2 changes: 1 addition & 1 deletion .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6b56937

Please sign in to comment.