From 6613de93e1ee1a49198ad5f837c68bc992bf0a30 Mon Sep 17 00:00:00 2001 From: Fabian Steeg Date: Thu, 15 Apr 2021 15:22:16 +0200 Subject: [PATCH] Publish to GitHub packages only when RC branch is pushed Use plain RC branch name as version during build See https://github.com/metafacture/metafacture-core/issues/356 --- .github/workflows/publish.yml | 4 +++- build.gradle | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6fcbe5740..5d637a7fb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,8 @@ name: Publish package to GitHub Packages on: - push + push: + branches: + - '*-rc*' jobs: publish: runs-on: ubuntu-latest diff --git a/build.gradle b/build.gradle index 7dbf6feb8..1b5fb1942 100644 --- a/build.gradle +++ b/build.gradle @@ -307,6 +307,10 @@ def getSnapshotVersion() { logger.lifecycle('Release branch found') return "${extractVersionFromBranch(grgit.branch.current().name)}-SNAPSHOT" } + if (grgit.branch.current().name.contains('-rc')) { + logger.lifecycle('Release candidate branch found') + return "${grgit.branch.current().name}" + } logger.lifecycle('Feature branch found') return "feature-${grgit.branch.current().name}-SNAPSHOT" }