Skip to content

Commit 3d77676

Browse files
committed
chore: add test pipeline
1 parent 3891e13 commit 3d77676

File tree

1 file changed

+103
-1
lines changed

1 file changed

+103
-1
lines changed

.github/workflows/release-to-maven-central.yml

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,16 @@ jobs:
3939
with:
4040
distribution: 'temurin'
4141
java-version: '17'
42+
server-id: central
43+
server-username: MAVEN_USERNAME
44+
server-password: MAVEN_PASSWORD
4245
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
46+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4347
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 }}
4452

4553
- name: Cache node modules
4654
uses: actions/cache@v4
@@ -56,11 +64,105 @@ jobs:
5664
run: mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress
5765

5866
- name: Publish package
59-
run: mvn -B deploy -X -pl spring-boot-admin-dependencies -DskipTests=true --no-transfer-progress -P central-deploy -DskipTests=true
67+
run: mvn -B deploy -DskipTests=true --no-transfer-progress -P central-deploy -DskipTests=true
6068
env:
6169
#TODO: This is a workaround for NEXUS-27902 which uses XStream that fails on JVM >16
6270
JDK_JAVA_OPTIONS: "--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED"
6371
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
6472
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
6573
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
6674

75+
- name: Deploy documentation to GitHub Pages for version ${{ github.event.inputs.releaseversion }}
76+
uses: JamesIves/github-pages-deploy-action@v4.7.2
77+
with:
78+
branch: gh-pages
79+
folder: spring-boot-admin-docs/target/generated-docs
80+
target-folder: ${{ github.event.inputs.releaseversion }}
81+
clean: true
82+
83+
- name: Deploy redirect for /current to /${{ github.event.inputs.releaseversion }}
84+
uses: JamesIves/github-pages-deploy-action@v4.7.2
85+
if: github.event.inputs.copyDocsToCurrent == 'true'
86+
with:
87+
branch: gh-pages
88+
folder: spring-boot-admin-docs/target/generated-docs/current
89+
target-folder: /current
90+
clean: true
91+
92+
- name: Deploy deeplink redirect for /current/* to /${{ github.event.inputs.releaseversion }}/*
93+
uses: JamesIves/github-pages-deploy-action@v4.7.2
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
100+
101+
publish-github-release:
102+
needs: publish-central-and-pages
103+
runs-on: ubuntu-latest
104+
105+
steps:
106+
- uses: actions/checkout@v4
107+
108+
- name: free disk space
109+
continue-on-error: true
110+
run: |
111+
df -h
112+
sudo swapoff -a
113+
sudo rm -f /swapfile
114+
sudo apt clean
115+
docker rmi $(docker image ls -aq)
116+
df -h
117+
118+
- name: Generate changelog
119+
id: changelog
120+
uses: metcalfc/changelog-generator@v4.3.1
121+
with:
122+
myToken: ${{ secrets.GITHUB_TOKEN }}
123+
124+
- name: Create GitHub Release
125+
id: create_release
126+
uses: actions/create-release@v1
127+
env:
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
with:
130+
tag_name: ${{ github.event.inputs.releaseversion }}
131+
release_name: ${{ github.event.inputs.releaseversion }}
132+
body: |
133+
Grab the new version from Maven central https://repo1.maven.org/maven2/de/codecentric/
134+
135+
Current docs at https://codecentric.github.io/spring-boot-admin/${{ github.event.inputs.releaseversion }}/
136+
137+
### Things that changed in this release
138+
${{ steps.changelog.outputs.changelog }}
139+
draft: false
140+
prerelease: ${{ contains(github.event.inputs.releaseversion, '-') }}
141+
142+
set-next-snapshot-version:
143+
needs: publish-github-release
144+
runs-on: ubuntu-latest
145+
146+
permissions:
147+
contents: write
148+
149+
steps:
150+
- uses: actions/checkout@v4
151+
152+
- name: Set new SNAPSHOT version
153+
run: >
154+
mvn versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" && \
155+
mvn versions:set -DnextSnapshot && \
156+
VERSION=$(mvn exec:exec -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive -q) && \
157+
mvn versions:revert && \
158+
mvn versions:set-property -Dproperty=revision -DnewVersion="$VERSION" &&
159+
mvn versions:commit
160+
161+
- name: Commit new SNAPSHOT version
162+
uses: stefanzweifel/git-auto-commit-action@v5
163+
env:
164+
GITHUB_TOKEN: ${{ secrets.PAT }}
165+
with:
166+
commit_message: "chore: update to next SNAPSHOT version"
167+
168+

0 commit comments

Comments
 (0)