88 publish :
99 runs-on : ubuntu-latest
1010 steps :
11- - uses : actions/checkout@v3
12- if : ${{ startsWith(github.event.release.tag_name, 'v1.' ) }}
13- with :
14- ref : " v1"
15- - uses : actions/checkout@v3
16- if : ${{ startsWith(github.event.release.tag_name, 'v2.') }}
17- with :
18- ref : " v2"
19- - uses : actions/checkout@v3
20- if : ${{ startsWith(github.event.release.tag_name, 'v3.') }}
21- with :
22- ref : " v3"
23- - uses : actions/checkout@v3
24- if : ${{ startsWith(github.event.release.tag_name, 'v4.') }}
25- - name : Set up Java and Maven
26- uses : actions/setup-java@v3
27- with :
28- java-version : 11
29- distribution : temurin
30- cache : ' maven'
31- - name : change version to release version
32- # Assume that RELEASE_VERSION will have form like: "v1.0.1". So we cut the "v"
33- run : ./mvnw ${MAVEN_ARGS} versions:set -DnewVersion="${RELEASE_VERSION:1}" versions:commit
11+ - if : ${{ startsWith(github.event.release.tag_name, 'v1.' ) }}
3412 env :
35- RELEASE_VERSION : ${{ github.event.release.tag_name }}
36- - name : change version to release version for bom module
37- working-directory : ./operator-framework-bom
38- run : ./mvnw ${MAVEN_ARGS} versions:set -DnewVersion="${RELEASE_VERSION:1}" versions:commit
13+ version-branch : " v1"
14+ - if : ${{ startsWith(github.event.release.tag_name, 'v2.' ) }}
3915 env :
40- RELEASE_VERSION : ${{ github.event.release.tag_name }}
41- - name : Release Maven package
42- uses : samuelmeuli/action-maven-publish@v1
43- with :
44- maven_profiles : " release"
45- gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
46- gpg_passphrase : ${{ secrets.GPG_PASSPHRASE }}
47- nexus_username : ${{ secrets.OSSRH_USERNAME }}
48- nexus_password : ${{ secrets.OSSRH_TOKEN }}
49-
50-
51- # This is separate job because there were issues with git after release step, was not able to commit changes. See history.
52- update-working-version :
53- runs-on : ubuntu-latest
54- if : " !contains(github.event.release.tag_name, 'RC')"
55- steps :
56- - uses : actions/checkout@v3
57- if : ${{ startsWith(github.event.release.tag_name, 'v1.' ) }}
58- with :
59- ref : " v1"
60- - uses : actions/checkout@v3
61- if : ${{ startsWith(github.event.release.tag_name, 'v2.') }}
62- with :
63- ref : " v2"
64- - uses : actions/checkout@v3
65- if : ${{ startsWith(github.event.release.tag_name, 'v3.') }}
66- with :
67- ref : " v3"
68- - uses : actions/checkout@v3
69- if : ${{ startsWith(github.event.release.tag_name, 'v4.') }}
70- - name : Set up Java and Maven
71- uses : actions/setup-java@v3
72- with :
73- java-version : 11
74- distribution : temurin
75- cache : ' maven'
76- - name : change version to release version
77- run : |
78- ./mvnw ${MAVEN_ARGS} versions:set -DnewVersion="${RELEASE_VERSION:1}" versions:commit
79- ./mvnw ${MAVEN_ARGS} -q build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT versions:commit
80- git config --local user.email "action@github.com"
81- git config --local user.name "GitHub Action"
82- git commit -m "Set new SNAPSHOT version into pom files." -a
16+ version-branch : " v2"
17+ - if : ${{ startsWith(github.event.release.tag_name, 'v3.' ) }}
8318 env :
84- RELEASE_VERSION : ${{ github.event.release.tag_name }}
85- - name : Push changes v1
86- uses : ad-m/github-push-action@master
87- if : ${{ startsWith(github.event.release.tag_name, 'v1.' ) }}
88- with :
89- github_token : ${{ secrets.GITHUB_TOKEN }}
90- branch : " v1"
91- - name : Push changes v2
92- uses : ad-m/github-push-action@master
93- if : ${{ startsWith(github.event.release.tag_name, 'v2.' ) }}
94- with :
95- github_token : ${{ secrets.GITHUB_TOKEN }}
96- branch : " v2"
97- - name : Push changes v3
98- uses : ad-m/github-push-action@master
99- if : ${{ startsWith(github.event.release.tag_name, 'v3.' ) }}
100- with :
101- github_token : ${{ secrets.GITHUB_TOKEN }}
102- branch : " v3"
103- - name : Push changes v4
104- uses : ad-m/github-push-action@master
105- if : ${{ startsWith(github.event.release.tag_name, 'v4.' ) }}
19+ version-branch : " v3"
20+ - if : ${{ startsWith(github.event.release.tag_name, 'v4.' ) }}
21+ env :
22+ version-branch : " main"
23+ - name : Fail if version-branch is not set
24+ if : " version-branch == ''"
25+ run : exit 1
26+
27+ - name : Release SDK
28+ uses : ./.github/workflows/release-project-in-dir.yml
10629 with :
107- github_token : ${{ secrets.GITHUB_TOKEN }}
30+ version-branch : ${{version-branch}}
31+ project-dir : ' .'
10832
33+ - name : Release BOM
34+ uses : ./.github/workflows/release-project-in-dir.yml
35+ with :
36+ version-branch : ${{version-branch}}
37+ project-dir : ' ./operator-framework-bom'
38+
0 commit comments