Skip to content

Commit 9196c91

Browse files
author
Dominick Leppich
committed
release: fix Jenkinsfile and GitHub actions, move install artifacts
1 parent ea610e9 commit 9196c91

File tree

5 files changed

+116
-75
lines changed

5 files changed

+116
-75
lines changed

.github/workflows/develop-build.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Development Build
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- 'develop'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
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+

.github/workflows/release-build.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Release Build
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- 'master'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
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+

.github/workflows/release.yml

-72
This file was deleted.

Jenkinsfile

+20-3
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,33 @@ pipeline {
4343
}
4444
}
4545

46-
stage('deploy-libs') {
46+
stage('deploy-snapshot-libs') {
4747
when {
4848
anyOf {
49-
branch 'master'
5049
branch 'develop'
5150
}
5251
}
5352
steps {
5453
script {
5554
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+
}
59+
}
60+
}
61+
}
62+
63+
stage('deploy-release-libs') {
64+
when {
65+
anyOf {
66+
branch 'master'
67+
}
68+
}
69+
steps {
70+
script {
71+
if (fileExists('module-lib/pom.xml')) {
72+
sh 'cat pom.xml | grep "SNAPSHOT" || true'
5673
sh 'mvn -N deploy'
5774
sh 'mvn -f module-lib/pom.xml deploy'
5875
}
@@ -63,7 +80,7 @@ pipeline {
6380

6481
post {
6582
always {
66-
junit "**/target/surefire-reports/*.xml"
83+
junit allowEmptyResults: true, testResults: "**/target/surefire-reports/*.xml"
6784
step([
6885
$class : 'JacocoPublisher',
6986
execPattern : '**/target/jacoco.exec',

0 commit comments

Comments
 (0)