1- name : release-to-maven-central
1+ name : Release To Maven Central
22
33on :
44 workflow_dispatch :
1313 type : boolean
1414 default : false
1515
16+ env :
17+ VERSION : ${{ github.event.inputs.releaseversion }}
18+
1619jobs :
1720 publish-central-and-pages :
1821 runs-on : ubuntu-latest
@@ -36,12 +39,16 @@ jobs:
3639 with :
3740 distribution : ' temurin'
3841 java-version : ' 17'
39- server-id : oss.sonatype.org
42+ server-id : central
4043 server-username : MAVEN_USERNAME
4144 server-password : MAVEN_PASSWORD
4245 gpg-private-key : ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
4346 gpg-passphrase : MAVEN_GPG_PASSPHRASE
4447 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 }}
4552
4653 - name : Cache node modules
4754 uses : actions/cache@v4
@@ -65,23 +72,31 @@ jobs:
6572 MAVEN_PASSWORD : ${{ secrets.OSS_SONATYPE_PASSWORD }}
6673 MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
6774
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
7077 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
7380 target-folder : ${{ github.event.inputs.releaseversion }}
74- clean : true # Automatically remove deleted files from the deploy branch
81+ clean : true
7582
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
7885 if : github.event.inputs.copyDocsToCurrent == 'true'
7986 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
8289 target-folder : /current
83- clean : true # Automatically remove deleted files from the deploy branch
90+ clean : true
8491
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
85100
86101 publish-github-release :
87102 needs : publish-central-and-pages
@@ -108,46 +123,11 @@ jobs:
108123
109124 - name : Create GitHub Release
110125 id : create_release
111- uses : actions/create-release@v1
112- env :
113- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
126+ uses : softprops/action-gh-release@v2
114127 with :
115128 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 }}
124130 draft : false
125131 prerelease : ${{ contains(github.event.inputs.releaseversion, '-') }}
126132
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-
153133
0 commit comments