-
Notifications
You must be signed in to change notification settings - Fork 10
111 lines (106 loc) · 3.16 KB
/
build-graalvm.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
name: Build-GraalVM
on:
push:
branches: '*'
tags: 'v*'
pull_request:
branches: '*'
jobs:
build-linux-graalvm:
name: Linux graalvm Build
# Build against a fixed version, as it determines our minimal Glibc requirements.
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up GraalVM
uses: ayltai/setup-graalvm@v1
with:
java-version: 17
graalvm-version: 22.3.1
native-image: true
- name: Build
env:
TEAMSCALE_ACCESS_KEY: ${{ secrets.TEAMSCALE_ACCESS_KEY }}
run: mvn clean verify
- name: Reduce Image Size
# As `upx` creates a statically-linked executable, the `runs-on` image
# above determines the minimally required version of Glibc.
uses: crazy-max/ghaction-upx@v1
with:
version: latest
file: ./target/teamscale-upload
- name: 'Upload Artifact'
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: target-linux
path: ./target
retention-days: 5
build-mac-graalvm:
name: MacOS graalvm Build
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Set up GraalVM
uses: ayltai/setup-graalvm@v1
with:
java-version: 17
graalvm-version: 22.3.1
native-image: true
- name: Build
env:
TEAMSCALE_ACCESS_KEY: ${{ secrets.TEAMSCALE_ACCESS_KEY }}
run: mvn clean verify
- name: 'Upload Artifact'
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: target-mac
path: ./target
retention-days: 5
build-windows-graalvm:
name: Windows graalvm Build
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Set up GraalVM
uses: ayltai/setup-graalvm@v1
with:
java-version: 17
graalvm-version: 22.3.1
native-image: true
- name: Build
env:
TEAMSCALE_ACCESS_KEY: ${{ secrets.TEAMSCALE_ACCESS_KEY }}
run: ./build-windows.bat
- name: 'Upload Artifact'
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: target-windows
path: ./target
retention-days: 5
release-graalvm:
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build-linux-graalvm
- build-mac-graalvm
- build-windows-graalvm
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- name: Package
run: |
(cd ./target-linux && zip ../teamscale-upload-linux.zip ./teamscale-upload)
(cd ./target-mac && zip ../teamscale-upload-mac.zip ./teamscale-upload)
(cd ./target-windows && zip ../teamscale-upload-windows.zip ./teamscale-upload.exe)
- name: Upload Release Assets
id: create_release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: teamscale-upload-*.zip
file_glob: true
overwrite: true