File tree 6 files changed +17
-9
lines changed
src/main/groovy/pl/allegro/tech/build/axion/release
6 files changed +17
-9
lines changed Original file line number Diff line number Diff line change 1
1
name : Build
2
2
3
- on :
3
+ on :
4
4
pull_request :
5
5
workflow_dispatch :
6
6
push :
31
31
uses : codecov/codecov-action@v5
32
32
with :
33
33
token : ${{ secrets.CODECOV_TOKEN }}
34
+
35
+ - name : Publish to staging repository
36
+ run : ./gradlew publishToSonatype currentVersion
37
+ env :
38
+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
39
+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
40
+ GPG_KEY_ID : ${{ secrets.GPG_KEY_ID }}
41
+ GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
42
+ GPG_PRIVATE_KEY_PASSWORD : ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}
Original file line number Diff line number Diff line change 9
9
runs-on : ubuntu-latest
10
10
steps :
11
11
- uses : actions/checkout@v4
12
- with :
13
- fetch-depth : 0
14
12
- name : Set up JDK
15
13
uses : actions/setup-java@v4
16
14
with :
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ plugins {
13
13
}
14
14
15
15
scmVersion {
16
- versionCreator( " versionWithBranch " )
16
+ unshallowRepoOnCI.set( true )
17
17
}
18
18
19
19
group = " pl.allegro.tech.build"
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ All `axion-release-plugin` configuration options:
76
76
77
77
// doc: Version / releaseOnlyOnReleaseBranches
78
78
releaseOnlyOnReleaseBranches = false
79
- releaseBranchNames = ['master', 'main']
79
+ releaseBranchNames = ['master', 'main', 'release/.*' ]
80
80
}
81
81
82
82
All ` axion-release-plugin ` configuration flags:
@@ -117,4 +117,4 @@ All `axion-release-plugin` configuration flags:
117
117
- only perform a release on branches that match the ` releaseBranchNames `
118
118
- release.releaseBranchNames
119
119
- default: ` ['master', 'main'] `
120
- - a list of branch names that are considered release branches
120
+ - a list of regex patterns for release branch names
Original file line number Diff line number Diff line change @@ -295,12 +295,12 @@ And works well in combination with `releaseBranchNames` option
295
295
296
296
scmVersion {
297
297
releaseOnlyOnReleaseBranches = true
298
- releaseBranchNames = ['main', 'master']
298
+ releaseBranchNames = ['main', 'master', 'release/.*' ]
299
299
}
300
300
301
301
or as command line
302
302
303
- ./gradlew release -Prelease.releaseOnlyOnReleaseBranches -Prelease.releaseBranchNames=main,release
303
+ ./gradlew release -Prelease.releaseOnlyOnReleaseBranches -Prelease.releaseBranchNames=" main,master, release/.*"
304
304
305
305
## Decorating
306
306
Original file line number Diff line number Diff line change @@ -99,8 +99,9 @@ abstract class ReleasePlugin implements Plugin<Project> {
99
99
def releaseOnlyOnReleaseBranches = context. scmService(). isReleaseOnlyOnReleaseBranches()
100
100
def releaseBranchNames = context. scmService(). getReleaseBranchNames()
101
101
def currentBranch = context. repository(). currentPosition(). getBranch()
102
+ def onReleaseBranch = releaseBranchNames. any { pattern -> currentBranch. matches(pattern) }
102
103
103
- def shouldSkipRelease = releaseOnlyOnReleaseBranches && ! releaseBranchNames . contains(currentBranch)
104
+ def shouldSkipRelease = releaseOnlyOnReleaseBranches && ! onReleaseBranch
104
105
105
106
if (shouldSkipRelease) {
106
107
disableReleaseTasks(currentBranch, releaseBranchNames, project)
You can’t perform that action at this time.
0 commit comments