-
Notifications
You must be signed in to change notification settings - Fork 1
173 lines (164 loc) · 5.52 KB
/
maven.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
on:
push:
branches: [ "trunk" ]
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B clean package -Pdep-check -Pcoverage
- id: version
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_OUTPUT"
- name: Upload Jar
uses: actions/upload-artifact@v4
with:
name: jar-with-dependencies
path: "pace-cli/target/*-jar-with-dependencies.jar"
package-osx:
needs: build
strategy:
matrix:
os: [ macos-14, macos-11 ]
runs-on: ${{ matrix.os }}
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set os/arch environment variables
run: |
echo "os=${RUNNER_OS}" >> $GITHUB_ENV
echo "arch=${RUNNER_ARCH}" >> $GITHUB_ENV
- name: Download Jar
uses: actions/download-artifact@v4
with:
name: jar-with-dependencies
path: jars
- name: Package jar as app-image
run: >
jpackage
--type app-image
--verbose
--vendor 'CIRES - University of Colorado'
--name 'pace-cli'
-i jars
--main-class edu.colorado.cires.pace.cli.Application
--main-jar pace-cli-${{ needs.build.outputs.version }}-jar-with-dependencies.jar
- name: Upload app image
uses: actions/upload-artifact@v4
with:
name: pace-cli-${{ env.os }}-${{ env.arch }}
path: "*.app"
package-linux:
needs: build
strategy:
matrix:
os: [ ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set os/arch environment variables
run: |
echo "os=${RUNNER_OS}" >> $GITHUB_ENV
echo "arch=${RUNNER_ARCH}" >> $GITHUB_ENV
- name: Download Jar
uses: actions/download-artifact@v4
with:
name: jar-with-dependencies
path: jars
- name: Package jar as app-image
run: >
jpackage
--type app-image
--verbose
--vendor 'CIRES - University of Colorado'
--name 'pace-cli'
-i jars
--main-class edu.colorado.cires.pace.cli.Application
--main-jar pace-cli-${{ needs.build.outputs.version }}-jar-with-dependencies.jar
- name: Upload app image
uses: actions/upload-artifact@v4
with:
name: pace-cli-${{ env.os }}-${{ env.arch }}
path: "pace-cli"
package-windows:
needs: build
strategy:
matrix:
os: [ windows-2019 ]
runs-on: ${{ matrix.os }}
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set os/arch environment variables
run: |
echo "os=$env:RUNNER_OS" >> $env:GITHUB_ENV
echo "arch=$env:RUNNER_ARCH" >> $env:GITHUB_ENV
- name: Download Jar
uses: actions/download-artifact@v4
with:
name: jar-with-dependencies
path: jars
- name: Package jar as app-image
run: >
jpackage
--type app-image
--verbose
--vendor 'CIRES - University of Colorado'
--name 'pace-cli'
-i jars
--dest application
--main-class edu.colorado.cires.pace.cli.Application
--main-jar pace-cli-${{ needs.build.outputs.version }}-jar-with-dependencies.jar
- name: Upload app image
uses: actions/upload-artifact@v4
with:
name: pace-cli-${{ env.os }}-${{ env.arch }}
path: application
release:
needs:
- build
- package-osx
- package-linux
- package-windows
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- run: mkdir release
- run: zip -r release/pace-cli-Linux-X64-${{ needs.build.outputs.version }}.zip pace-cli-Linux-X64
- run: zip -r release/pace-cli-macOS-ARM64-${{ needs.build.outputs.version }}.zip pace-cli-macOS-ARM64
- run: zip -r release/pace-cli-macOS-X64-${{ needs.build.outputs.version }}.zip pace-cli-macOS-X64
- run: zip -r release/pace-cli-Windows-X64-${{ needs.build.outputs.version }}.zip pace-cli-Windows-X64
- run: cp jar-with-dependencies/* release/pace-cli-${{ needs.build.outputs.version }}-exe.jar
- name: Update branch release
uses: eine/tip@master
with:
tag: ${{ github.ref_name }}-latest
rm: true
token: ${{ secrets.RELEASE_PAT }}
files: release/*