1
- name : release-to-maven-central
1
+ name : Release To Maven Central
2
2
3
3
on :
4
4
workflow_dispatch :
13
13
type : boolean
14
14
default : false
15
15
16
+ env :
17
+ VERSION : ${{ github.event.inputs.releaseversion }}
18
+
16
19
jobs :
17
20
publish-central-and-pages :
18
21
runs-on : ubuntu-latest
@@ -36,12 +39,16 @@ jobs:
36
39
with :
37
40
distribution : ' temurin'
38
41
java-version : ' 17'
39
- server-id : oss.sonatype.org
42
+ server-id : central
40
43
server-username : MAVEN_USERNAME
41
44
server-password : MAVEN_PASSWORD
42
45
gpg-private-key : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
43
46
gpg-passphrase : MAVEN_GPG_PASSPHRASE
44
47
cache : ' maven'
48
+ env :
49
+ MAVEN_USERNAME : ${{ secrets.OSS_SONATYPE_USERNAME }}
50
+ MAVEN_PASSWORD : ${{ secrets.OSS_SONATYPE_PASSWORD }}
51
+ MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
45
52
46
53
- name : Cache node modules
47
54
uses : actions/cache@v4
@@ -65,23 +72,31 @@ jobs:
65
72
MAVEN_PASSWORD : ${{ secrets.OSS_SONATYPE_PASSWORD }}
66
73
MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
67
74
68
- - name : Deploy Asciidoc docs output to GitHub Pages
69
- uses : JamesIves/github-pages-deploy-action@v4.6.8
75
+ - name : Deploy documentation to GitHub Pages for version ${{ github.event.inputs.releaseversion }}
76
+ uses : JamesIves/github-pages-deploy-action@v4.7.3
70
77
with :
71
- branch : gh-pages # The branch the action should deploy to.
72
- folder : spring-boot-admin-docs/target/generated-docs # The folder the action should deploy.
78
+ branch : gh-pages
79
+ folder : spring-boot-admin-docs/target/generated-docs
73
80
target-folder : ${{ github.event.inputs.releaseversion }}
74
- clean : true # Automatically remove deleted files from the deploy branch
81
+ clean : true
75
82
76
- - name : Deploy Asciidoc docs output to GitHub Pages
77
- uses : JamesIves/github-pages-deploy-action@v4.6.8
83
+ - name : Deploy redirect for /current to /${{ github.event.inputs.releaseversion }}
84
+ uses : JamesIves/github-pages-deploy-action@v4.7.3
78
85
if : github.event.inputs.copyDocsToCurrent == 'true'
79
86
with :
80
- branch : gh-pages # The branch the action should deploy to.
81
- folder : spring-boot-admin-docs/target/generated-docs # The folder the action should deploy.
87
+ branch : gh-pages
88
+ folder : spring-boot-admin-docs/target/generated-docs/current
82
89
target-folder : /current
83
- clean : true # Automatically remove deleted files from the deploy branch
90
+ clean : true
84
91
92
+ - name : Deploy deeplink redirect for /current/* to /${{ github.event.inputs.releaseversion }}/*
93
+
94
+ if : github.event.inputs.copyDocsToCurrent == 'true'
95
+ with :
96
+ branch : gh-pages
97
+ folder : spring-boot-admin-docs/target/generated-docs/current
98
+ target-folder : /
99
+ clean : false
85
100
86
101
publish-github-release :
87
102
needs : publish-central-and-pages
@@ -108,46 +123,11 @@ jobs:
108
123
109
124
- name : Create GitHub Release
110
125
id : create_release
111
- uses : actions/create-release@v1
112
- env :
113
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
126
+ uses : softprops/action-gh-release@v2
114
127
with :
115
128
tag_name : ${{ github.event.inputs.releaseversion }}
116
- release_name : ${{ github.event.inputs.releaseversion }}
117
- body : |
118
- Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/
119
-
120
- Current docs at https://codecentric.github.io/spring-boot-admin/${{ github.event.inputs.releaseversion }}/
121
-
122
- ### Things that changed in this release
123
- ${{ steps.changelog.outputs.changelog }}
129
+ token : ${{ secrets.GITHUB_TOKEN }}
124
130
draft : false
125
131
prerelease : ${{ contains(github.event.inputs.releaseversion, '-') }}
126
132
127
- set-next-snapshot-version :
128
- needs : publish-github-release
129
- runs-on : ubuntu-latest
130
-
131
- permissions :
132
- contents : write
133
-
134
- steps :
135
- - uses : actions/checkout@v4
136
-
137
- - name : Set new SNAPSHOT version
138
- run : >
139
- mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" && \
140
- mvn versions:set -DnextSnapshot && \
141
- VERSION=$(mvn exec:exec -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive -q) && \
142
- mvn versions:revert && \
143
- mvn versions:set-property -Dproperty=revision -DnewVersion="$VERSION" &&
144
- mvn versions:commit
145
-
146
- - name : Commit new SNAPSHOT version
147
- uses : stefanzweifel/git-auto-commit-action@v5
148
- env :
149
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
150
- with :
151
- commit_message : " chore: update to next SNAPSHOT version"
152
-
153
133
0 commit comments