-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (81 loc) · 2.54 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Java CI with Maven
on:
push:
branches:
- main
- develop
tags:
- v[0-9]+.[0-9]+.[0-9]+.[0-9]+**
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
# Set up maven repository credentials for highmed-dsf dependencies
server-id: highmed-dsf
server-username: USERNAME
server-password: GITHUB_TOKEN
- name: Cache Local Maven Repo
uses: actions/cache@v3
with:
path: |
~/.m2/repository
key: maven-repo
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
- name: Build with Maven
run: mvn -B verify --file pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.actor }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
build:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare Version
id: prep
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
# Set up maven repository credentials for highmed-dsf dependencies
server-id: highmed-dsf
server-username: USERNAME
server-password: GITHUB_TOKEN
- name: Cache Local Maven Repo
uses: actions/cache@v3
with:
path: |
~/.m2/repository
key: maven-repo
- name: Add GitHub Server Credentials to Maven settings.xml
uses: s4u/[email protected]
with:
servers: '[{"id": "highmed-dsf", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}]'
- name: Set Version in Maven Parent Project and Submodules
run: mvn -q versions:set -DnewVersion="${{ steps.prep.outputs.version }}" -DprocessAllModules=true
- name: Build with Maven
run: mvn -B deploy -DskipTests --file feasibility-dsf-process/pom.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USERNAME: ${{ github.actor }}
- name: Release
uses: softprops/action-gh-release@v1
with:
files: feasibility-dsf-process/target/feasibility-dsf-process-*.jar
name: "Feasibility DSF Process - v${{ steps.prep.outputs.version }}"