Skip to content

Commit 45b5de9

Browse files
author
Dominick Leppich
committed
ci: update to latest CI scripts
1 parent 9196c91 commit 45b5de9

File tree

3 files changed

+100
-91
lines changed

3 files changed

+100
-91
lines changed

.github/workflows/develop-build.yml

+33-34
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,36 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Check out source code
16-
uses: actions/checkout@v4
17-
- name: Set up JDK 11
18-
uses: actions/setup-java@v1
19-
with:
20-
java-version: 11
21-
- name: Set up Maven cache
22-
uses: actions/cache@v1
23-
with:
24-
path: ~/.m2/repository
25-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
26-
restore-keys: |
27-
${{ runner.os }}-maven-
28-
- name: Build with Maven
29-
run: mvn clean verify -U
30-
- name: Get current date
31-
id: date
32-
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"
33-
- name: Create tag name from date
34-
id: tagdate
35-
run: echo "::set-output name=tagdate::$(date +'%Y-%m-%d_%H-%M-%S_%Z')"
36-
- name: Release
37-
id: create_release
38-
uses: softprops/action-gh-release@v2
39-
with:
40-
name: ${{ steps.date.outputs.date }}
41-
tag_name: ${{ steps.tagdate.outputs.tagdate }}
42-
generate_release_notes: true
43-
draft: false
44-
prerelease: true
45-
files: |
46-
**/target/*.jar
47-
install/*
48-
15+
- name: Check out source code
16+
uses: actions/checkout@v4
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 17
21+
- name: Set up Maven cache
22+
uses: actions/cache@v1
23+
with:
24+
path: ~/.m2/repository
25+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
26+
restore-keys: |
27+
${{ runner.os }}-maven-
28+
- name: Build with Maven
29+
run: mvn clean verify -U -P snapshot-build
30+
- name: Get current date
31+
id: date
32+
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"
33+
- name: Create tag name from date
34+
id: tagdate
35+
run: echo "::set-output name=tagdate::$(date +'%Y-%m-%d_%H-%M-%S_%Z')"
36+
- name: Release
37+
id: create_release
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
name: ${{ steps.date.outputs.date }}
41+
tag_name: ${{ steps.tagdate.outputs.tagdate }}
42+
generate_release_notes: true
43+
draft: false
44+
prerelease: true
45+
files: |
46+
**/target/*.war
47+
install/*

.github/workflows/release-build.yml

+34-37
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,45 @@
1-
name: Publish Release Build
1+
name: Publish Development Build
2+
3+
permissions:
4+
contents: write
5+
6+
name: Publish Development Build
27

38
permissions:
49
contents: write
510

611
on:
712
push:
8-
branches:
9-
- 'master'
13+
tags:
14+
- 'v*'
1015

1116
jobs:
1217
build:
1318
runs-on: ubuntu-latest
1419
steps:
15-
- name: Check out source code
16-
uses: actions/checkout@v4
17-
- name: Set up JDK 11
18-
uses: actions/setup-java@v1
19-
with:
20-
java-version: 11
21-
- name: Set up Maven cache
22-
uses: actions/cache@v1
23-
with:
24-
path: ~/.m2/repository
25-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
26-
restore-keys: |
27-
${{ runner.os }}-maven-
28-
- name: Build with Maven
29-
run: mvn clean verify -U
30-
- name: Get current date
31-
id: date
32-
run: echo "::set-output name=date::$(date +'%Y-%m-%d %H:%M:%S %Z')"
33-
- name: Create tag name from date
34-
id: tagdate
35-
run: echo "::set-output name=tagdate::$(date +'%Y-%m-%d_%H-%M-%S_%Z')"
36-
- name: Release
37-
id: create_release
38-
uses: softprops/action-gh-release@v2
39-
with:
40-
name: ${{ steps.date.outputs.date }}
41-
tag_name: ${{ steps.tagdate.outputs.tagdate }}
42-
generate_release_notes: true
43-
draft: false
44-
prerelease: false
45-
files: |
46-
**/target/*.jar
47-
install/*
48-
20+
- name: Check out source code
21+
uses: actions/checkout@v4
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 17
26+
- name: Set up Maven cache
27+
uses: actions/cache@v1
28+
with:
29+
path: ~/.m2/repository
30+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
31+
restore-keys: |
32+
${{ runner.os }}-maven-
33+
- name: Build with Maven
34+
run: mvn clean verify -U -P release-build
35+
- name: Release
36+
id: create_release
37+
uses: softprops/action-gh-release@v2
38+
with:
39+
name: Release ${{ github.ref_name }}
40+
generate_release_notes: true
41+
draft: false
42+
prerelease: false
43+
files: |
44+
**/target/*.war
45+
install/*

Jenkinsfile

+33-20
Original file line numberDiff line numberDiff line change
@@ -22,54 +22,67 @@ pipeline {
2222
}
2323
}
2424

25-
stage('build') {
25+
stage('build-snapshot') {
26+
when {
27+
not {
28+
anyOf {
29+
branch 'master'
30+
branch 'release_*'
31+
allOf {
32+
branch 'PR-*'
33+
expression { env.CHANGE_BRANCH.startsWith("release_") }
34+
}
35+
}
36+
}
37+
}
2638
steps {
27-
sh 'mvn clean verify -U'
28-
recordIssues enabledForFailure: true, aggregatingResults: true, tools: [java(), javaDoc()]
39+
sh 'mvn clean verify -U -P snapshot-build'
2940
}
3041
}
31-
32-
stage('sonarcloud') {
42+
stage('build-release') {
3343
when {
3444
anyOf {
3545
branch 'master'
36-
branch 'sonar_*'
46+
branch 'release_*'
47+
allOf {
48+
branch 'PR-*'
49+
expression { env.CHANGE_BRANCH.startsWith("release_") }
50+
}
3751
}
3852
}
3953
steps {
40-
withCredentials([string(credentialsId: 'jenkins-sonarcloud', variable: 'TOKEN')]) {
41-
sh 'mvn verify sonar:sonar -Dsonar.token=$TOKEN -U'
42-
}
54+
sh 'mvn clean verify -U -P release-build'
4355
}
4456
}
45-
46-
stage('deploy-snapshot-libs') {
57+
stage('sonarcloud') {
4758
when {
4859
anyOf {
49-
branch 'develop'
60+
branch 'master'
61+
branch 'release_*'
62+
branch 'sonar_*'
63+
allOf {
64+
branch 'PR-*'
65+
expression { env.CHANGE_BRANCH.startsWith("release_") }
66+
}
5067
}
5168
}
5269
steps {
53-
script {
54-
if (fileExists('module-lib/pom.xml')) {
55-
sh 'cat pom.xml | grep "SNAPSHOT"'
56-
sh 'mvn -N deploy'
57-
sh 'mvn -f module-lib/pom.xml deploy'
58-
}
70+
withCredentials([string(credentialsId: 'jenkins-sonarcloud', variable: 'TOKEN')]) {
71+
sh 'mvn verify sonar:sonar -Dsonar.token=$TOKEN -U'
5972
}
6073
}
6174
}
6275

63-
stage('deploy-release-libs') {
76+
stage('deploy-libs') {
6477
when {
6578
anyOf {
6679
branch 'master'
80+
branch 'develop'
6781
}
6882
}
6983
steps {
7084
script {
7185
if (fileExists('module-lib/pom.xml')) {
72-
sh 'cat pom.xml | grep "SNAPSHOT" || true'
7386
sh 'mvn -N deploy'
7487
sh 'mvn -f module-lib/pom.xml deploy'
7588
}

0 commit comments

Comments
 (0)