1
- name : Maven release
1
+ name : Release artifacts
2
2
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
- releaseVersion :
7
- description : " Release version."
6
+ release_version :
7
+ description : ' The version to be released from actual HEAD revision'
8
+ required : false
9
+ default : ' X.Y.Z'
10
+ development_version :
11
+ description : ' Version to be set as next, after release is made (appends commit to HEAD revision)'
12
+ required : false
13
+ default : ' X.Y.Z-SNAPSHOT'
14
+ perform_version :
15
+ description : ' Tag which should be used to perform release and publish its artifacts'
16
+ required : false
17
+ dry_run :
18
+ description : ' Should execution abstain from mutating repository/remote state?'
8
19
required : true
9
- default : " X.Y.Z"
10
- developmentVersion :
11
- description : " Version to which working copy should be set after release."
12
- required : true
13
- default : " X.Y.Z-SNAPSHOT"
14
- dryRun :
15
- description : " Should release be done in dry-run mode."
16
- required : true
17
- default : " true"
20
+ default : ' true'
18
21
19
22
jobs :
20
- release :
21
- runs-on : ubuntu-latest
23
+ build :
22
24
permissions :
23
25
contents : write
24
- steps :
25
- - uses : actions/checkout@v3
26
- - name : Setup git
27
- run : |
28
- git config user.email "[email protected] "
29
- git config user.name "ConnectorIO Bot"
30
- git config url."https://${BUILD_USER}:${BUILD_TOKEN}@github.com/".insteadOf "[email protected] :"
31
- export GIT_TRACE_PACKET=1
32
- export GIT_TRACE=1
33
- export GIT_CURL_VERBOSE=1
34
- env :
35
- BUILD_USER : x-access-token
36
- BUILD_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37
- - uses : actions/setup-java@v3
38
- with :
39
- distribution : ' temurin'
40
- java-version : ' 11'
41
- server-id : sonatype-nexus-staging
42
- server-username : CI_RELEASE_USERNAME
43
- server-password : CI_RELEASE_PASSWORD
44
- gpg-passphrase : GPG_PASSPHRASE
45
- gpg-private-key : ${{ secrets.GPG_PRIVATE_KEY }}
46
- - name : Cache local Maven repository
47
- uses : actions/cache@v3
48
- with :
49
- path : ~/.m2/repository
50
- key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
51
- restore-keys : |
52
- ${{ runner.os }}-maven-
53
- - name : Maven Prepare Release
54
- run : >-
55
- mvn -B
56
- release:prepare -DpreparationProfiles=release
57
- -DreleaseVersion=${{ inputs.releaseVersion }}
58
- -DdevelopmentVersion=${{ inputs.developmentVersion }}
59
- -DdryRun=${{ inputs.dryRun }}
60
- - name : Maven Perform Release
61
- if : success()
62
- run : >-
63
- mvn -B
64
- release:perform -DreleaseProfiles=release
65
- env :
66
- CI_RELEASE_USERNAME : ${{ secrets.CI_RELEASE_USERNAME }}
67
- CI_RELEASE_PASSWORD : ${{ secrets.CI_RELEASE_PASSWORD }}
68
- GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
69
- - name : Rollback on failure
70
- if : failure()
71
- run : |
72
- mvn -B release:rollback
73
- echo "You may need to manually delete the git tag, if it was created."
26
+ uses : ' connectorio/gh-actions-shared/.github/workflows/release.yml@master'
27
+ secrets :
28
+ GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
29
+ GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
30
+ CI_RELEASE_USERNAME : ${{ secrets.CI_RELEASE_USERNAME }}
31
+ CI_RELEASE_PASSWORD : ${{ secrets.CI_RELEASE_PASSWORD }}
32
+ with :
33
+ openhab : false
34
+ server_id : ' sonatype-nexus-staging'
35
+ master_branch : 1.3.x
36
+ release_version : ${{ inputs.release_version }}
37
+ development_version : ${{ inputs.development_version }}
38
+ perform_version : ${{ inputs.perform_version }}
39
+ dry_run : ${{ inputs.dry_run }}
0 commit comments