Skip to content

Commit

Permalink
Do not release snapshot if performing non-snapshot deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
utybo committed Jun 2, 2022
1 parent d96c64b commit df8cbad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:

publish-snapshot:
name: Publish snapshot
if: "github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/'))"
if: "github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
needs: [validate-wrapper, check]
steps:
Expand All @@ -150,7 +150,7 @@ jobs:
name: Publish release
if: "github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
needs: [ validate-wrapper, check, publish-snapshot, build-deploy-website ]
needs: [ validate-wrapper, check, build-deploy-website ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ plugins {
publishing {
repositories {
if (project.hasProperty("publishSnapshot")) {
maven {
name = "mavenCentralSnapshots"
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
credentials(PasswordCredentials)
if (project.version.endsWith("-SNAPSHOT")) {
maven {
name = "mavenCentralSnapshots"
url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
credentials(PasswordCredentials)
}
} else {
logger.warning("-PpublishSnapshot is present, but no -SNAPSHOT suffix: skipping snapshot deployment")
}
} else if (project.hasProperty("publishRelease")) {
if (project.version.endsWith("-SNAPSHOT")) {
Expand Down

0 comments on commit df8cbad

Please sign in to comment.