@@ -41,13 +41,16 @@ jobs:
41
41
matrix :
42
42
java : ['8', '11', '17']
43
43
steps :
44
- - uses : actions/checkout@v2
45
- - uses : actions/cache@v1
44
+ - name : Checkout Source Code
45
+ uses : actions/checkout@v2
46
+ - name : Setup Maven Cache
47
+ uses : actions/cache@v1
46
48
with :
47
49
path : ~/.m2
48
50
key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
49
51
restore-keys : ${{ runner.os }}-m2
50
- - uses : actions/cache@v1
52
+ - name : Setup Sonar Cache
53
+ uses : actions/cache@v1
51
54
with :
52
55
path : ~/.sonar/cache
53
56
key : ${{ runner.os }}-sonar
@@ -78,27 +81,33 @@ jobs:
78
81
SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
79
82
SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
80
83
SONATYPE_GPG_PASSPHRASE : ${{ secrets.SONATYPE_GPG_PASSPHRASE }}
84
+ - name : Archive Linux Native Image
85
+ if : success() && (matrix.java == '11')
86
+ uses : actions/upload-artifact@v2
87
+ with :
88
+ name : linux-native-image
89
+ path : distributions/linux/target/sourcehawk
81
90
- name : Archive Native Image JAR
82
- if : success()
91
+ if : success() && (matrix.java == '11')
83
92
uses : actions/upload-artifact@v2
84
93
with :
85
- name : native-image-${{ matrix.java }}
94
+ name : native-image-jar
86
95
path : cli/target/*-native-image.jar
87
- - name : Archive Bash Completion Script
88
- if : success()
96
+ - name : Archive Completion Script
97
+ if : success() && (matrix.java == '11')
89
98
uses : actions/upload-artifact@v2
90
99
with :
91
- name : bash- completion-script-${{ matrix.java }}
92
- path : cli/target/sourcehawk-bash- completion.sh
100
+ name : completion-script
101
+ path : cli/target/sourcehawk-completion.sh
93
102
- name : Archive Manpages
94
- if : success()
103
+ if : success() && (matrix.java == '11')
95
104
uses : actions/upload-artifact@v2
96
105
with :
97
- name : manpages-${{ matrix.java }}
106
+ name : manpages
98
107
path : gh-pages/manpages/sourcehawk*.1
99
108
- name : Aggregate Coverage Reports
100
109
id : aggregate_coverage_reports
101
- if : success()
110
+ if : success() && (matrix.java == '11')
102
111
run : echo ::set-output name=JACOCO_XML_REPORT_PATHS::$(find . -name "jacoco.xml" -printf '%P\n' | tr '\r\n' ',')
103
112
- name : Analyze with SonarCloud
104
113
if : success() && (github.event_name == 'push' && matrix.java == '11')
@@ -118,39 +127,39 @@ jobs:
118
127
runs-on : macos-latest
119
128
needs : build
120
129
steps :
121
- - uses : actions/download-artifact@v2
130
+ - name : Download Native Image JAR
131
+ uses : actions/download-artifact@v2
122
132
with :
123
- name : native-image-8
133
+ name : native-image-jar
124
134
path : build
125
- - uses : actions/download-artifact@v2
135
+ - name : Download Completion Script
136
+ uses : actions/download-artifact@v2
126
137
with :
127
- name : bash- completion-script-8
138
+ name : completion-script
128
139
path : build
129
- - uses : actions/download-artifact@v2
140
+ - name : Download Manpages
141
+ uses : actions/download-artifact@v2
130
142
with :
131
- name : manpages-8
143
+ name : manpages
132
144
path : build
133
145
- name : Rename Native Image JAR
134
146
working-directory : build
135
147
run : mv *.jar native-image.jar
136
- - name : Setup Java
137
- uses : actions/setup-java@v1
138
- with :
139
- java-version : 8
140
148
- name : Setup GraalVM
141
- uses : DeLaGuardo /setup-graalvm@master
149
+ uses : graalvm /setup-graalvm@v1
142
150
with :
143
- graalvm-version : 21.2.0.java8
144
- - name : Setup GraalVM Native Image Tool
145
- run : gu install native-image
151
+ version : ' 21.3.0'
152
+ java-version : ' 11'
153
+ components : ' native-image'
154
+ github-token : ${{ secrets.GITHUB_TOKEN }}
146
155
- name : Build Mac Native Image
147
156
if : success()
148
157
working-directory : build
149
158
run : native-image -cp native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime --no-fallback
150
159
- name : Create Homebrew Tap Formula Archive
151
160
if : success()
152
161
working-directory : build
153
- run : gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-bash- completion.sh sourcehawk*.1.gz
162
+ run : gzip sourcehawk*.1 && tar -czvf sourcehawk-homebrew-tap-formula.tar.gz sourcehawk sourcehawk-completion.sh sourcehawk*.1.gz
154
163
- name : Archive Mac Native Image
155
164
if : success()
156
165
continue-on-error : true
@@ -172,28 +181,26 @@ jobs:
172
181
build-windows-native-image :
173
182
runs-on : windows-latest
174
183
needs : build
184
+ continue-on-error : true
175
185
steps :
176
- - uses : actions/download-artifact@v2
186
+ - name : Download Native Image JAR
187
+ uses : actions/download-artifact@v2
177
188
with :
178
- name : native-image-11
189
+ name : native-image-jar
179
190
path : build
180
191
- name : Rename Native Image JAR
181
192
working-directory : build
182
193
run : ren *.jar native-image.jar
183
- - name : Setup GraalVM Native Image and Visual C Build Tools
184
- run : |
185
- Invoke-RestMethod -Uri https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-21.3.0/graalvm-ce-java11-windows-amd64-21.3.0.zip -OutFile 'graal.zip'
186
- Expand-Archive -path 'graal.zip' -destinationpath '.'
187
- graalvm-ce-java11-21.3.0\bin\gu.cmd install native-image
188
- choco install visualstudio2017-workload-vctools
194
+ - name : Setup GraalVM
195
+ uses : graalvm/setup-graalvm@v1
196
+ with :
197
+ version : ' 20.3.0'
198
+ java-version : ' 11'
199
+ components : ' native-image'
200
+ github-token : ${{ secrets.GITHUB_TOKEN }}
189
201
- name : Build Windows Native Image
190
202
if : success()
191
- shell : cmd
192
- run : |
193
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
194
- graalvm-ce-java11-21.3.0\bin\native-image -cp .\build\native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime
195
- env :
196
- JAVA_HOME : ./graalvm-ce-java11-21.3.0
203
+ run : native-image.cmd -cp .\build\native-image.jar -H:+ReportExceptionStackTraces --report-unsupported-elements-at-runtime
197
204
- name : Archive Windows Native Image
198
205
if : success()
199
206
continue-on-error : true
@@ -204,4 +211,4 @@ jobs:
204
211
- name : Smoke Test
205
212
if : success()
206
213
shell : cmd
207
- run : sourcehawk.exe help
214
+ run : sourcehawk.exe help
0 commit comments