File tree 3 files changed +79
-16
lines changed
3 files changed +79
-16
lines changed Original file line number Diff line number Diff line change @@ -12,11 +12,11 @@ previous_release_version=$( \
12
12
-H " Accept: application/vnd.github+json" \
13
13
https://api.github.com/repos/microsoft/gctoolkit/releases/latest | grep ' tag_name' \
14
14
)
15
- previous_release_version=$( perl -pe ' s/"tag_name":\s+"(.*?)",?/$1/' <<< $ previous_release_version )
15
+ previous_release_version=$( perl -pe ' s/"tag_name":\s+"(.*?)",?/$1/' <<< " ${ previous_release_version} " )
16
16
17
17
release_version=$( git tag --sort=-taggerdate --list | head -n 1 )
18
18
19
19
./mvnw -B -pl :gctoolkit -Pjreleaser jreleaser:release \
20
- -Djreleaser.previous.tag.name=${previous_release_version} \
21
- -Djreleaser.tag.name=${release_version}
20
+ -Djreleaser.previous.tag.name=" ${previous_release_version} " \
21
+ -Djreleaser.tag.name=" ${release_version} "
22
22
Original file line number Diff line number Diff line change
1
+ name : Release to GitHub
2
+
3
+ on :
4
+ workflow_dispatch :
5
+
6
+ jobs :
7
+ release :
8
+
9
+ runs-on : ubuntu-latest
10
+
11
+ steps :
12
+ - name : Checkout project
13
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14
+ with :
15
+ ref : main
16
+ fetch-depth : 0
17
+
18
+ - name : Cache Maven
19
+ uses : actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
20
+ with :
21
+ path : ~/.m2/repository
22
+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
23
+ restore-keys : ${{ runner.os }}-m2
24
+
25
+ - name : Setup Java JDK
26
+ uses : actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
27
+ with :
28
+ java-version : ' 11'
29
+ distribution : ' microsoft'
30
+
31
+ - name : Version
32
+ id : version
33
+ run : |
34
+ release_version=$( ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout )
35
+ release_version=${release_version%-*}
36
+ echo "version=${release_version}" >> "$GITHUB_ENV"
37
+
38
+ # Get the previous release version from what is actually on GitHub
39
+ previous_release_version=$( ./mvnw help:evaluate -Dexpression=project.scm.tag -q -DforceStdout )
40
+ echo "previous_version=${previous_release_version}" >> "$GITHUB_ENV"
41
+
42
+ - name : Release Prepare
43
+ run : |
44
+ ./mvnw -B -Prelease release:clean release:prepare \
45
+ -Drepository.url=https://${{ github.actor }}:${{ secrets.RELEASE_TOKEN }}@github.com/${{ github.repository }}.git
46
+ env :
47
+ GIT_AUTHOR_NAME : ' Git'
48
+ GIT_AUTHOR_EMAIL : ' noreply@github.com'
49
+ GIT_COMMITTER_NAME : ' Git'
50
+ GIT_COMMITTER_EMAIL : ' noreply@github.com'
51
+
52
+ - name : Release to GitHub
53
+ run : |
54
+ ./mvnw -B -pl :gctoolkit -Pjreleaser jreleaser:release \
55
+ -Djreleaser.previous.tag.name="$previous_version" \
56
+ -Djreleaser.tag.name="$version"
57
+ env :
58
+ JRELEASER_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 277
277
</dependency >
278
278
</dependencies >
279
279
</plugin >
280
+ <plugin >
281
+ <groupId >org.apache.maven.plugins</groupId >
282
+ <artifactId >maven-release-plugin</artifactId >
283
+ <version >${maven.release-plugin.version} </version >
284
+ <configuration >
285
+ <releaseProfiles >release</releaseProfiles >
286
+ <projectVersionPolicyId >SemVerVersionPolicy</projectVersionPolicyId >
287
+ </configuration >
288
+ </plugin >
280
289
<plugin >
281
290
<groupId >org.apache.maven.plugins</groupId >
282
291
<artifactId >maven-surefire-plugin</artifactId >
432
441
<artifactId >apache-rat-plugin</artifactId >
433
442
<configuration >
434
443
<skip >true</skip >
435
- <executions >
436
- <execution >
437
- <phase >validate</phase >
438
- <goals >
439
- <goal >check</goal >
440
- </goals >
441
- <configuration >
442
- <excludes >
443
- <exclude >gclogs/**</exclude >
444
- </excludes >
445
- </configuration >
446
- </execution >
447
- </executions >
448
444
</configuration >
449
445
</plugin >
450
446
<plugin >
521
517
</execution >
522
518
</executions >
523
519
</plugin >
520
+ <plugin >
521
+ <groupId >org.apache.maven.plugins</groupId >
522
+ <artifactId >maven-release-plugin</artifactId >
523
+ <configuration >
524
+ <tagNameFormat >gctoolkit-${project.version} </tagNameFormat >
525
+ <autoVersionSubmodules >true</autoVersionSubmodules >
526
+ <preparationGoals >clean site</preparationGoals >
527
+ </configuration >
528
+ </plugin >
524
529
</plugins >
525
530
</build >
526
531
</profile >
You can’t perform that action at this time.
0 commit comments