11name : Release
22
3+ # Process
4+ # -------
5+ #
6+ # 1) mvn release:prepare
7+ # => change version for release in pom.xml files to vX.Y.0
8+ # => update readme
9+ # => run unit+integration tests
10+ # => commit
11+ # => tag
12+ # => change version for future developments in pom.xml files to vU.V.0-SNAPSHOT
13+ #
14+ # 2) Trigger a full build on tagged version and wait for result
15+ # => build from tag
16+ # => run unit+integration tests
17+ # => run classpath-tests
18+ # => generate javadoc
19+ #
20+ # 3) mvn release:perform to finish the release
21+ # => deploy on Sonatype
22+ #
23+ # 4) Trigger a site generation on tagged version
24+ #
25+ # 5) Create branch for fixes
26+ # => change versions to vX.Y.1-SNAPSHOT
27+ #
28+ #
29+ # Rollback
30+ # --------
31+ #
32+ # 1) mvn release:rollback
33+ # 2) delete tag
34+ # 3) restore previous commit (before version changes)
35+ # 3) mvn release:clean
36+ # 4) remove from Sonatype if deployed
37+
338on :
439 workflow_dispatch :
540 inputs :
1146 description : ' Next dev version'
1247 required : true
1348 default : ' 3.1.0-SNAPSHOT'
49+ fix-version :
50+ description : ' Fixes version'
51+ required : true
52+ default : ' 3.0.1-SNAPSHOT'
1453
1554jobs :
16- mutation-tests :
55+ # FIXME: maven-release-plugin can't be used due to issue: https://issues.apache.org/jira/browse/MRELEASE-920
56+ # release:
57+ # runs-on: ubuntu-18.04
58+ # steps:
59+ # - uses: actions/checkout@v2
60+ # - uses: actions/setup-java@v1
61+ # with:
62+ # java-version: 8
63+ # - name: Cache Maven packages
64+ # uses: actions/cache@v2
65+ # with:
66+ # path: |
67+ # ~/.m2/repository
68+ # !~/.m2/repository/fr/sii/
69+ # key: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
70+ # restore-keys: ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}
71+ # - name: "Release"
72+ # run:
73+ # ./mvnw release:prepare
74+ # -DreleaseVersion=${{ github.event.inputs.release-version }}
75+ # -DdevelopmentVersion=${{ github.event.inputs.next-dev-version }}
76+ # -B
77+ release :
78+ runs-on : ubuntu-18.04
79+ steps :
80+ - uses : actions/checkout@v2
81+ - uses : actions/setup-java@v1
82+ with :
83+ java-version : 8
84+ - name : Cache Maven packages
85+ uses : actions/cache@v2
86+ with :
87+ path : |
88+ ~/.m2/repository
89+ !~/.m2/repository/fr/sii/
90+ key : ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
91+ restore-keys : ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}
92+ - name : Prepare git
93+ run : |
94+ git config user.email [email protected] 95+ git config user.name github-actions
96+ - name : " Set release version (${{ github.event.inputs.release-version }})"
97+ run : |
98+ ./mvnw versions:set -DnewVersion=${{ github.event.inputs.release-version }} -DprocessAllModules
99+ ./mvnw com.google.code.maven-replacer-plugin:replacer:replace -N
100+ ./mvnw versions:commit
101+ - name : " Generate README.adoc"
102+ run :
103+ ./mvnw initialize '-Dreadme.skip=false'
104+ - name : " Build to ensure that it works fine"
105+ run :
106+ ./mvnw clean install '-Dmaven.test.redirectTestOutputToFile=true'
107+ - name : " Commit release version"
108+ run : |
109+ git add .
110+ git commit -m "release(${{ github.event.inputs.release-version }}) Prepare for release"
111+ git push
112+
113+ test-release :
114+ needs : [release]
115+ runs-on : ubuntu-18.04
116+ steps :
117+ - uses : aurelien-baudet/workflow-dispatch@master
118+ with :
119+ token : ${{ secrets.TRIGGER_WORKFLOW_TOKEN }}
120+ workflow : build.yml
121+ wait-for-completion-interval : 10m
122+ wait-for-completion-timeout : 4h
123+ # ref: v${{ github.event.inputs.release-version }}
124+
125+ deploy-release :
126+ needs : [test-release]
127+ runs-on : ubuntu-18.04
128+ steps :
129+ - uses : actions/checkout@v2
130+ with :
131+ fetch-depth : 0
132+ - uses : actions/setup-java@v1
133+ with :
134+ java-version : 8
135+ - name : Cache Maven packages
136+ uses : actions/cache@v2
137+ with :
138+ path : |
139+ ~/.m2/repository
140+ !~/.m2/repository/fr/sii/
141+ key : ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
142+ restore-keys : ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}
143+ - name : Prepare git
144+ run : |
145+ git config user.email [email protected] 146+ git config user.name github-actions
147+ - run : git pull
148+ - name : " Tag release version"
149+ run : |
150+ git tag -a "v${{ github.event.inputs.release-version }}" -m "release(${{ github.event.inputs.release-version }}) Release"
151+ git push origin "v${{ github.event.inputs.release-version }}"
152+ - name : " Import GPG key"
153+ uses : crazy-max/ghaction-import-gpg@v3
154+ with :
155+ gpg-private-key : ${{ secrets.RELEASE_GPG_PRIVATE_KEY }}
156+ passphrase : ${{ secrets.RELEASE_GPG_PASSPHRASE }}
157+ # - name: "Deploy release"
158+ # run:
159+ # ./mvnw -Prelease deploy
160+ # --settings .github/deploy-settings.xml
161+ # '-DskipTests=true'
162+ # -B
163+
164+ set-next-version :
165+ needs : [deploy-release]
166+ runs-on : ubuntu-18.04
167+ steps :
168+ - uses : actions/checkout@v2
169+ with :
170+ fetch-depth : 0
171+ - uses : actions/setup-java@v1
172+ with :
173+ java-version : 8
174+ - name : Cache Maven packages
175+ uses : actions/cache@v2
176+ with :
177+ path : |
178+ ~/.m2/repository
179+ !~/.m2/repository/fr/sii/
180+ key : ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
181+ restore-keys : ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}
182+ - name : Prepare git
183+ run : |
184+ git config user.email [email protected] 185+ git config user.name github-actions
186+ - run : git pull
187+ - name : " Set next development version on master (${{ github.event.inputs.next-dev-version }})"
188+ run : |
189+ ./mvnw versions:set -DnewVersion=${{ github.event.inputs.next-dev-version }} -DprocessAllModules
190+ ./mvnw com.google.code.maven-replacer-plugin:replacer:replace -N
191+ ./mvnw versions:commit
192+ - name : " Generate README.adoc"
193+ run :
194+ ./mvnw initialize '-Dreadme.skip=false'
195+ - name : " Commit next development iteration"
196+ run : |
197+ git add .
198+ git commit -m "release(${{ github.event.inputs.release-version }}) Prepare for next development iteration"
199+ git push
200+
201+ update-site :
202+ needs : [set-next-version]
203+ runs-on : ubuntu-18.04
204+ steps :
205+ - uses : aurelien-baudet/workflow-dispatch@master
206+ with :
207+ token : ${{ secrets.TRIGGER_WORKFLOW_TOKEN }}
208+ workflow : update-site.yml
209+ ref : v${{ github.event.inputs.release-version }}
210+
211+ create-or-update-fix-branch :
212+ needs : [update-site]
213+ runs-on : ubuntu-18.04
214+ steps :
215+ - uses : actions/checkout@v2
216+ with :
217+ fetch-depth : 0
218+ - uses : actions/setup-java@v1
219+ with :
220+ java-version : 8
221+ - name : Cache Maven packages
222+ uses : actions/cache@v2
223+ with :
224+ path : |
225+ ~/.m2/repository
226+ !~/.m2/repository/fr/sii/
227+ key : ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}-${{ hashFiles('**/pom.xml') }}
228+ restore-keys : ${{ runner.os }}-m2-${{ secrets.CACHE_VERSION }}
229+ - name : Prepare git
230+ run : |
231+ git config user.email [email protected] 232+ git config user.name github-actions
233+ - name : " Get fix branch"
234+ run :
235+ RELEASE_VERSION=${{ github.event.inputs.release-version }}
236+ FIX_BRANCH="v${RELEASE_VERSION%.*}.x"
237+ echo "FIX_BRANCH=$FIX_BRANCH" >> $GITHUB_ENV
238+ - name : " Set version"
239+ run : |
240+ echo "FIX_BRANCH=$FIX_BRANCH"
241+ EXISTS=$(git ls-remote --heads origin ${FIX_BRANCH})
242+ if [ -z "$EXISTS" ]; then
243+ git checkout "v${{ github.event.inputs.release-version }}"
244+ git checkout -b "$FIX_BRANCH"
245+ else
246+ git checkout "$FIX_BRANCH"
247+ fi
248+ ./mvnw versions:set -DnewVersion=${{ github.event.inputs.fix-version }} -DprocessAllModules
249+ ./mvnw com.google.code.maven-replacer-plugin:replacer:replace -N
250+ ./mvnw versions:commit
251+ - name : " Generate README.adoc"
252+ run :
253+ ./mvnw initialize '-Dreadme.skip=false'
254+ - name : " Create fix branch or update it"
255+ run :
256+ git add .
257+ git commit -m "chore(bump) Change version number for next fix version"
258+ git push
259+
260+ rollback :
261+ needs : [release, test-release, deploy-release, set-next-version, update-site, create-or-update-fix-branch]
262+ if : always()
17263 runs-on : ubuntu-18.04
18264 steps :
19- - run : echo "foo"
265+ - uses : aurelien-baudet/workflow-dispatch@master
266+ with :
267+ token : ${{ secrets.TRIGGER_WORKFLOW_TOKEN }}
268+ inputs : |
269+ {
270+ "release-version": "${{ github.event.inputs.release-version }}",
271+ "revert-to": "${{ github.sha }}"
272+ }
273+ workflow : release-rollback.yml
274+ wait-for-completion-interval : 1m
275+ wait-for-completion-timeout : 1h
276+
0 commit comments