Skip to content

Commit

Permalink
Publish to GitHub packages only when RC branch is pushed
Browse files Browse the repository at this point in the history
Use plain RC branch name as version during build

See #356
  • Loading branch information
fsteeg committed Apr 20, 2021
1 parent 08685dc commit 6613de9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Publish package to GitHub Packages
on:
push
push:
branches:
- '*-rc*'
jobs:
publish:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down

0 comments on commit 6613de9

Please sign in to comment.