141 lines (122 loc) · 3.98 KB
/
publish.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
name: Publish
on:
release:
types: [published]
env:
graalvm_version: '22.0.0.2'
java_version: '17'
branch: 'spring-native'
jobs:
build:
name: GraalVM - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
with:
ref: '${{ env.branch }}'
- name: Set up GraalVM (Java ${{ env.java_version }})
uses: graalvm/setup-graalvm@v1
with:
version: '${{ env.graalvm_version }}'
java-version: '${{ env.java_version }}'
components: 'native-image'
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Cache npm dependencies
uses: actions/cache@v2
with:
path: |
~/.npm
~/.cache/Cypress/
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
- name: Set up swap space
if: runner.os == 'Linux'
uses: pierotofy/set-swap-space@v1.0
with:
swap-size-gb: 10
- name: Build native images
run: ./mvnw -B -ntp package -Pnative,prod -DskipTests
- name: Archive binary
uses: actions/upload-artifact@v2
with:
name: flickr2-${{ matrix.os }}-x86_64
path: target/native-executable
- name: Rename binary
run: mv target/native-executable target/flickr2-${{ runner.os }}-${{ github.event.release.tag_name }}-x86_64
- name: Upload release
uses: alexellis/upload-assets@0.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["target/flickr2-${{ runner.os }}*"]'
build-windows:
name: GraalVM - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v2
with:
ref: '${{ env.branch }}'
- uses: ilammy/msvc-dev-cmd@v1
- uses: microsoft/setup-msbuild@v1
- name: Set up GraalVM (Java ${{ env.java_version }})
uses: graalvm/setup-graalvm@v1
with:
version: '${{ env.graalvm_version }}'
java-version: '${{ env.java_version }}'
components: 'native-image'
- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven
- name: Cache npm dependencies
uses: actions/cache@v2
with:
path: |
~/.npm
~/.cache/Cypress/
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
- name: Configure pagefile
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 10GB
maximum-size: 12GB
- name: Set up pagefile
run: |
(Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize
- name: mvnw --version
run: mvnw --version
shell: cmd
- name: Maven resolve
run: mvnw -B -ntp dependency:resolve-plugins
shell: cmd
- name: Build native images
run: mvnw -B -ntp package -Pnative,prod -DskipTests
shell: cmd
- name: Archive binary
uses: actions/upload-artifact@v2
with:
name: flickr-${{ matrix.os }}-x86_64.exe
path: target/native-executable.exe
- name: Rename binary
run: move target/native-executable.exe target/flickr2-${{ runner.os }}-${{ github.event.release.tag_name }}-x86_64.exe
- name: Upload release
uses: alexellis/upload-assets@0.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["target/flickr2-${{ runner.os }}*"]'