Skip to content

Commit 56e2e1c

Browse files
authored
Merge pull request #61 from xdev-software/develop
Release
2 parents a1b7a38 + 3c61914 commit 56e2e1c

23 files changed

Lines changed: 1225 additions & 244 deletions

File tree

.config/pmd/java/ruleset.xml

Lines changed: 858 additions & 5 deletions
Large diffs are not rendered by default.

.github/workflows/broken-links.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,32 @@ jobs:
1313
runs-on: ubuntu-latest
1414
timeout-minutes: 15
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717

1818
- run: mv .github/.lycheeignore .lycheeignore
1919

2020
- name: Link Checker
2121
id: lychee
22-
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2
22+
uses: lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2
2323
with:
2424
fail: false # Don't fail on broken links, create an issue instead
2525

2626
- name: Find already existing issue
2727
id: find-issue
2828
run: |
29-
echo "number=$(gh issue list -l 'bug' -l 'automated' -L 1 -S 'in:title \"Link Checker Report\"' -s 'open' --json 'number' --jq '.[].number')" >> $GITHUB_OUTPUT
29+
echo "number=$(gh issue list -l 'bug' -l 'automated' -L 1 -S 'in:title "Link Checker Report"' -s 'open' --json 'number' --jq '.[].number')" >> $GITHUB_OUTPUT
3030
env:
3131
GH_TOKEN: ${{ github.token }}
32-
32+
3333
- name: Close issue if everything is fine
34-
if: env.lychee_exit_code == 0 && steps.find-issue.outputs.number != ''
34+
if: steps.lychee.outputs.exit_code == 0 && steps.find-issue.outputs.number != ''
3535
run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }}
3636
env:
3737
GH_TOKEN: ${{ github.token }}
3838

3939
- name: Create Issue From File
40-
if: env.lychee_exit_code != 0
41-
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5
40+
if: steps.lychee.outputs.exit_code != 0
41+
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6
4242
with:
4343
issue-number: ${{ steps.find-issue.outputs.number }}
4444
title: Link Checker Report

.github/workflows/check-build.yml

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,45 @@ on:
2020
- 'assets/**'
2121

2222
env:
23-
PRIMARY_MAVEN_MODULE: ${{ github.event.repository.name }}
2423
DEMO_MAVEN_MODULE: ${{ github.event.repository.name }}-demo
2524

2625
jobs:
2726
build:
2827
runs-on: ubuntu-latest
2928
timeout-minutes: 30
30-
3129
strategy:
3230
matrix:
33-
java: [17, 21]
31+
java: [17, 21, 25]
3432
distribution: [temurin]
35-
3633
steps:
37-
- uses: actions/checkout@v4
38-
34+
- uses: actions/checkout@v5
35+
3936
- name: Set up JDK
40-
uses: actions/setup-java@v4
37+
uses: actions/setup-java@v5
4138
with:
4239
distribution: ${{ matrix.distribution }}
4340
java-version: ${{ matrix.java }}
44-
cache: 'maven'
45-
41+
42+
- name: Cache Maven
43+
uses: actions/cache@v4
44+
with:
45+
path: ~/.m2/repository
46+
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
47+
restore-keys: |
48+
${{ runner.os }}-mvn-build-
49+
50+
- name: Cache Vaadin prod bundles
51+
uses: actions/cache@v4
52+
with:
53+
path: |
54+
**/bundles/prod.bundle
55+
key: ${{ runner.os }}-vaadin-prod-bundles-${{ hashFiles('**/pom.xml') }}
56+
restore-keys: |
57+
${{ runner.os }}-vaadin-prod-bundles-
58+
4659
- name: Build with Maven
47-
run: ./mvnw -B clean package -Pproduction
48-
60+
run: ./mvnw -B clean package
61+
4962
- name: Check for uncommited changes
5063
run: |
5164
if [[ "$(git status --porcelain)" != "" ]]; then
@@ -75,21 +88,34 @@ jobs:
7588
runs-on: ubuntu-latest
7689
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
7790
timeout-minutes: 15
78-
7991
strategy:
8092
matrix:
8193
java: [17]
8294
distribution: [temurin]
83-
8495
steps:
85-
- uses: actions/checkout@v4
86-
96+
- uses: actions/checkout@v5
97+
8798
- name: Set up JDK
88-
uses: actions/setup-java@v4
99+
uses: actions/setup-java@v5
89100
with:
90101
distribution: ${{ matrix.distribution }}
91102
java-version: ${{ matrix.java }}
92-
cache: 'maven'
103+
104+
- name: Cache Maven
105+
uses: actions/cache@v4
106+
with:
107+
path: ~/.m2/repository
108+
key: ${{ runner.os }}-mvn-checkstyle-${{ hashFiles('**/pom.xml') }}
109+
restore-keys: |
110+
${{ runner.os }}-mvn-checkstyle-
111+
112+
- name: CheckStyle Cache
113+
uses: actions/cache@v4
114+
with:
115+
path: '**/target/checkstyle-cachefile'
116+
key: ${{ runner.os }}-checkstyle-${{ hashFiles('**/pom.xml') }}
117+
restore-keys: |
118+
${{ runner.os }}-checkstyle-
93119
94120
- name: Run Checkstyle
95121
run: ./mvnw -B checkstyle:check -P checkstyle -T2C
@@ -98,21 +124,34 @@ jobs:
98124
runs-on: ubuntu-latest
99125
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
100126
timeout-minutes: 15
101-
102127
strategy:
103128
matrix:
104129
java: [17]
105130
distribution: [temurin]
106-
107131
steps:
108-
- uses: actions/checkout@v4
132+
- uses: actions/checkout@v5
109133

110134
- name: Set up JDK
111-
uses: actions/setup-java@v4
135+
uses: actions/setup-java@v5
112136
with:
113137
distribution: ${{ matrix.distribution }}
114138
java-version: ${{ matrix.java }}
115-
cache: 'maven'
139+
140+
- name: Cache Maven
141+
uses: actions/cache@v4
142+
with:
143+
path: ~/.m2/repository
144+
key: ${{ runner.os }}-mvn-pmd-${{ hashFiles('**/pom.xml') }}
145+
restore-keys: |
146+
${{ runner.os }}-mvn-pmd-
147+
148+
- name: PMD Cache
149+
uses: actions/cache@v4
150+
with:
151+
path: '**/target/pmd/pmd.cache'
152+
key: ${{ runner.os }}-pmd-${{ hashFiles('**/pom.xml') }}
153+
restore-keys: |
154+
${{ runner.os }}-pmd-
116155
117156
- name: Run PMD
118157
run: ./mvnw -B test pmd:aggregate-pmd-no-fork pmd:check -P pmd -DskipTests -T2C

.github/workflows/release.yml

Lines changed: 64 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,30 @@ permissions:
1111
contents: write
1212
pull-requests: write
1313

14+
# DO NOT RESTORE CACHE for critical release steps to prevent a (extremely unlikely) scenario
15+
# where a supply chain attack could be achieved due to poisoned cache
1416
jobs:
1517
check-code:
1618
runs-on: ubuntu-latest
1719
timeout-minutes: 30
1820
steps:
19-
- uses: actions/checkout@v4
20-
21+
- uses: actions/checkout@v5
22+
2123
- name: Set up JDK
22-
uses: actions/setup-java@v4
24+
uses: actions/setup-java@v5
2325
with:
2426
java-version: '17'
2527
distribution: 'temurin'
26-
cache: 'maven'
27-
28+
29+
# Try to reuse existing cache from check-build
30+
- name: Try restore Maven Cache
31+
uses: actions/cache/restore@v4
32+
with:
33+
path: ~/.m2/repository
34+
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
35+
restore-keys: |
36+
${{ runner.os }}-mvn-build-
37+
2838
- name: Build with Maven
2939
run: ./mvnw -B clean package -Pproduction -T2C
3040

@@ -51,45 +61,37 @@ jobs:
5161
needs: [check-code]
5262
timeout-minutes: 10
5363
outputs:
54-
upload_url: ${{ steps.create_release.outputs.upload_url }}
64+
upload_url: ${{ steps.create-release.outputs.upload_url }}
5565
steps:
56-
- uses: actions/checkout@v4
57-
66+
- uses: actions/checkout@v5
67+
5868
- name: Configure Git
5969
run: |
6070
git config --global user.email "actions@github.com"
6171
git config --global user.name "GitHub Actions"
62-
72+
6373
- name: Un-SNAP
64-
run: |
65-
mvnwPath=$(readlink -f ./mvnw)
66-
modules=("") # root
67-
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
68-
for i in "${modules[@]}"
69-
do
70-
echo "Processing $i/pom.xml"
71-
(cd "$i" && $mvnwPath -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false)
72-
done
73-
74+
run: ./mvnw -B versions:set -DremoveSnapshot -DprocessAllModules -DgenerateBackupPoms=false
75+
7476
- name: Get version
7577
id: version
7678
run: |
7779
version=$(../mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
7880
echo "release=$version" >> $GITHUB_OUTPUT
7981
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
8082
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
81-
83+
8284
- name: Commit and Push
8385
run: |
8486
git add -A
8587
git commit -m "Release ${{ steps.version.outputs.release }}"
8688
git push origin
8789
git tag v${{ steps.version.outputs.release }}
8890
git push origin --tags
89-
91+
9092
- name: Create Release
91-
id: create_release
92-
uses: shogo82148/actions-create-release@4661dc54f7b4b564074e9fbf73884d960de569a3 # v1
93+
id: create-release
94+
uses: shogo82148/actions-create-release@7b89596097b26731bda0852f1504f813499079ee # v1
9395
with:
9496
tag_name: v${{ steps.version.outputs.release }}
9597
release_name: v${{ steps.version.outputs.release }}
@@ -116,27 +118,43 @@ jobs:
116118
needs: [prepare-release]
117119
timeout-minutes: 60
118120
steps:
119-
- uses: actions/checkout@v4
120-
121+
- uses: actions/checkout@v5
122+
121123
- name: Init Git and pull
122124
run: |
123125
git config --global user.email "actions@github.com"
124126
git config --global user.name "GitHub Actions"
125127
git pull
126-
128+
127129
- name: Set up JDK
128-
uses: actions/setup-java@v4
129-
with: # running setup-java again overwrites the settings.xml
130+
uses: actions/setup-java@v5
131+
with: # running setup-java overwrites the settings.xml
132+
distribution: 'temurin'
130133
java-version: '17'
134+
server-id: github-central
135+
server-password: PACKAGES_CENTRAL_TOKEN
136+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
137+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Only import once
138+
139+
- name: Publish to GitHub Packages Central
140+
run: ../mvnw -B deploy -P publish -DskipTests -DaltDeploymentRepository=github-central::https://maven.pkg.github.com/xdev-software/central
141+
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
142+
env:
143+
PACKAGES_CENTRAL_TOKEN: ${{ secrets.PACKAGES_CENTRAL_TOKEN }}
144+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
145+
146+
- name: Set up JDK
147+
uses: actions/setup-java@v5
148+
with: # running setup-java again overwrites the settings.xml
131149
distribution: 'temurin'
150+
java-version: '17'
132151
server-id: sonatype-central-portal
133152
server-username: MAVEN_CENTRAL_USERNAME
134153
server-password: MAVEN_CENTRAL_TOKEN
135154
gpg-passphrase: MAVEN_GPG_PASSPHRASE
136-
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
137155

138156
- name: Publish to Central Portal
139-
run: ../mvnw -B deploy -P publish-sonatype-central-portal -DskipTests
157+
run: ../mvnw -B deploy -P publish,publish-sonatype-central-portal -DskipTests
140158
env:
141159
MAVEN_CENTRAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
142160
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
@@ -148,20 +166,28 @@ jobs:
148166
needs: [prepare-release]
149167
timeout-minutes: 15
150168
steps:
151-
- uses: actions/checkout@v4
152-
169+
- uses: actions/checkout@v5
170+
153171
- name: Init Git and pull
154172
run: |
155173
git config --global user.email "actions@github.com"
156174
git config --global user.name "GitHub Actions"
157175
git pull
158176
159177
- name: Setup - Java
160-
uses: actions/setup-java@v4
178+
uses: actions/setup-java@v5
161179
with:
162180
java-version: '17'
163181
distribution: 'temurin'
164-
cache: 'maven'
182+
183+
# Try to reuse existing cache from check-build
184+
- name: Try restore Maven Cache
185+
uses: actions/cache/restore@v4
186+
with:
187+
path: ~/.m2/repository
188+
key: ${{ runner.os }}-mvn-build-${{ hashFiles('**/pom.xml') }}
189+
restore-keys: |
190+
${{ runner.os }}-mvn-build-
165191
166192
- name: Build site
167193
run: ../mvnw -B compile site -DskipTests -T2C
@@ -179,31 +205,23 @@ jobs:
179205
needs: [publish-maven]
180206
timeout-minutes: 10
181207
steps:
182-
- uses: actions/checkout@v4
183-
208+
- uses: actions/checkout@v5
209+
184210
- name: Init Git and pull
185211
run: |
186212
git config --global user.email "actions@github.com"
187213
git config --global user.name "GitHub Actions"
188214
git pull
189215
190216
- name: Inc Version and SNAP
191-
run: |
192-
mvnwPath=$(readlink -f ./mvnw)
193-
modules=("") # root
194-
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
195-
for i in "${modules[@]}"
196-
do
197-
echo "Processing $i/pom.xml"
198-
(cd "$i" && $mvnwPath -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true -DupdateMatchingVersions=false)
199-
done
217+
run: ./mvnw -B versions:set -DnextSnapshot -DprocessAllModules -DgenerateBackupPoms=false
200218

201219
- name: Git Commit and Push
202220
run: |
203221
git add -A
204222
git commit -m "Preparing for next development iteration"
205223
git push origin
206-
224+
207225
- name: pull-request
208226
env:
209227
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)