Skip to content

Commit 1e9e751

Browse files
bnasslahsenclaude
andcommitted
ci: add release and jhipster compatibility workflows
Adds the two workflows that had no GitHub Actions equivalent yet: - release.yml: workflow_dispatch release via maven-release-plugin, with a dry-run mode. Releases were previously done by hand; no Jenkins job covered this. - compat-jhipster.yml: replaces the jhipster-bom-IC Jenkins job. It lives here because workflows cannot be added to jhipster/jhipster-bom. pom.xml: - maven-release-plugin 2.5.3 -> 3.1.1. 2.5.3 dates from 2015 and is not maintained against current Maven and git. - releaseProfiles gpg -> ci,gpg. release:perform activates releaseProfiles with -P, which deactivates the activeByDefault ci profile and resets skip.npm to true, so a release built from a clean tree would ship jars missing the frontend bundle. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 4fea5e1 commit 1e9e751

3 files changed

Lines changed: 152 additions & 2 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Downstream compatibility check: builds jhipster/jhipster-bom against a given
2+
# springdoc-openapi version. It lives here rather than in jhipster-bom because
3+
# we cannot add workflows to a repository we do not own.
4+
name: JHipster compatibility
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
springdocVersion:
10+
description: 'springdoc-openapi version to test against, e.g. 3.1.1'
11+
required: true
12+
jhipsterRef:
13+
description: 'jhipster-bom branch or tag'
14+
default: main
15+
16+
jobs:
17+
compat:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 45
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
repository: jhipster/jhipster-bom
24+
ref: ${{ inputs.jhipsterRef }}
25+
26+
- uses: actions/setup-java@v4
27+
with:
28+
java-version: '21'
29+
distribution: temurin
30+
cache: maven
31+
32+
# A SNAPSHOT under test will not be on Central release; allow the
33+
# snapshot repository so unreleased versions can be checked too.
34+
- name: Allow Central snapshots
35+
run: |
36+
mkdir -p ~/.m2
37+
cat > ~/.m2/settings.xml <<'XML'
38+
<settings>
39+
<profiles>
40+
<profile>
41+
<id>central-snapshots</id>
42+
<repositories>
43+
<repository>
44+
<id>central-snapshots</id>
45+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
46+
<snapshots><enabled>true</enabled></snapshots>
47+
<releases><enabled>false</enabled></releases>
48+
</repository>
49+
</repositories>
50+
</profile>
51+
</profiles>
52+
<activeProfiles><activeProfile>central-snapshots</activeProfile></activeProfiles>
53+
</settings>
54+
XML
55+
56+
- name: Build jhipster-bom
57+
run: mvn -B --no-transfer-progress install -Dspringdocs.version='${{ inputs.springdocVersion }}'

.github/workflows/release.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Cuts a release: tags it, publishes to Maven Central, bumps to the next SNAPSHOT.
2+
# Run it from the branch you want to release (main or spring-boot-3).
3+
name: Release
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
releaseVersion:
9+
description: 'Version to release, e.g. 3.1.1'
10+
required: true
11+
developmentVersion:
12+
description: 'Next development version, e.g. 3.1.2-SNAPSHOT'
13+
required: true
14+
dryRun:
15+
description: 'Rehearse only: no tag, no push, no publish'
16+
type: boolean
17+
default: false
18+
19+
# release:prepare pushes the version-bump commits and the tag.
20+
permissions:
21+
contents: write
22+
23+
concurrency:
24+
group: release-${{ github.ref }}
25+
cancel-in-progress: false
26+
27+
env:
28+
MAVEN_ARGS: -B --no-transfer-progress -Dmaven.artifact.threads=16
29+
MAVEN_OPTS: -Xmx3g
30+
31+
jobs:
32+
release:
33+
runs-on: ubuntu-latest
34+
timeout-minutes: 90
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
# release:prepare inspects history and tags.
39+
fetch-depth: 0
40+
41+
- uses: actions/setup-java@v4
42+
with:
43+
java-version: '21'
44+
distribution: temurin
45+
cache: maven
46+
server-id: central
47+
server-username: MAVEN_USERNAME
48+
server-password: MAVEN_PASSWORD
49+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
50+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
51+
52+
- name: Cache npm
53+
uses: actions/cache@v4
54+
with:
55+
path: ~/.npm
56+
key: npm-${{ hashFiles('**/src/main/frontend/package-lock.json') }}
57+
restore-keys: npm-
58+
59+
- name: Configure git
60+
run: |
61+
git config user.name 'github-actions[bot]'
62+
git config user.email 'github-actions[bot]@users.noreply.github.com'
63+
# <scm> uses an SSH URL, and release:perform clones it fresh into
64+
# target/checkout. The runner has no SSH key, so route it over HTTPS.
65+
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf 'git@github.com:'
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
# Tests run once, here. The release build itself uses -DskipTests so the
70+
# suite is not executed a third time (release:prepare verifies, then
71+
# release:perform builds again from the tag).
72+
- name: Test
73+
run: mvn $MAVEN_ARGS -Pci -T1C test
74+
75+
- name: Release
76+
run: |
77+
mvn $MAVEN_ARGS release:prepare release:perform \
78+
-DreleaseVersion='${{ inputs.releaseVersion }}' \
79+
-DdevelopmentVersion='${{ inputs.developmentVersion }}' \
80+
-DdryRun=${{ inputs.dryRun }} \
81+
-Darguments="-DskipTests"
82+
env:
83+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
84+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
85+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
88+
- name: Clean up a dry run
89+
if: ${{ inputs.dryRun }}
90+
run: mvn $MAVEN_ARGS release:clean

pom.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<properties>
5757
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
58-
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
58+
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
5959
<central-publishing-maven-plugin.version>0.11.0
6060
</central-publishing-maven-plugin.version>
6161
<flatten-maven-plugin.version>1.5.0</flatten-maven-plugin.version>
@@ -277,7 +277,10 @@
277277
<tagNameFormat>v@{project.version}</tagNameFormat>
278278
<autoVersionSubmodules>true</autoVersionSubmodules>
279279
<useReleaseProfile>false</useReleaseProfile>
280-
<releaseProfiles>gpg</releaseProfiles>
280+
<!-- ci as well as gpg: release:perform activates these with -P,
281+
which would otherwise deactivate the activeByDefault ci
282+
profile and silently skip the npm frontend build. -->
283+
<releaseProfiles>ci,gpg</releaseProfiles>
281284
<goals>deploy</goals>
282285
</configuration>
283286
</plugin>

0 commit comments

Comments
 (0)