-
Notifications
You must be signed in to change notification settings - Fork 11
553 lines (491 loc) · 26.6 KB
/
test.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2011-2021 ETH Zurich.
name: Test and create release (when run manually)
on:
push: # run this workflow on every push
pull_request: # run this workflow on every pull_request
workflow_dispatch: # allow to manually trigger this workflow
inputs:
type:
type: choice
description: 'Specifies whether a stable release, nightly release or release candidate should be triggered.'
required: true
default: 'nightly'
options:
- stable
- nightly
- rc
viperserver_tag_name:
description: 'Tag name of ViperServer release from which server JAR should be downloaded'
required: true
boogie_tag_name:
description: 'Tag name of Boogie release from which the Boogie binaries should be downloaded. Can be set to be "latest"'
required: true
default: 'latest'
z3_version:
description: 'Z3 version that should be downloaded and included in a release'
required: true
default: '4.8.7'
tag_name:
description: 'Tag name for stable release.'
required: true
default: '-'
release_name:
description: 'Release title for stable release.'
required: true
default: '-'
# note that release-candidate builds are treated like 'stable' builds for now except that there is no deployment to the marketplaces in the end.
# in the future, this should be changed such that release-candidates result in a prerelease (like nightly builds).
# the following env variables configure the behavior of this workflow
# in particular, they control whether Viper-IDE is tested against certain ViperTools and a ViperServer JAR on push and pull requests
# this is particularly useful during debugging / testing as a new Viper-IDE release is not necessary for every change to the ViperServer JAR
env:
TEST_LOCAL_ON_PUSH_PR: false
# note that the following URL is extended with `/${{ matrix.viper-tools-zip-file }}` in the 'build-and-test' job:
TEST_LOCAL_ON_PUSH_PR_VIPERTOOLS_URL: https://github.com/viperproject/viper-ide/releases/download/v-2022-09-21-1611
# the following URL is not extended and downloading the destination is expected to return the viperserver.jar:
TEST_LOCAL_ON_PUSH_PR_VIPERSERVER_URL: https://polybox.ethz.ch/index.php/s/54sDcqHDJHelKBY/download
jobs:
create-viper-tools:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
env:
VIPERSERVER_URL: "https://github.com/viperproject/viperserver/releases/download/${{ github.event.inputs.viperserver_tag_name }}/viperserver.jar"
WIN_Z3_URL: "https://github.com/Z3Prover/z3/releases/download/z3-${{ github.event.inputs.z3_version }}/z3-${{ github.event.inputs.z3_version }}-x64-win.zip"
LINUX_Z3_URL: "https://github.com/Z3Prover/z3/releases/download/z3-${{ github.event.inputs.z3_version }}/z3-${{ github.event.inputs.z3_version }}-x64-ubuntu-16.04.zip"
MAC_Z3_URL: "https://github.com/Z3Prover/z3/releases/download/z3-${{ github.event.inputs.z3_version }}/z3-${{ github.event.inputs.z3_version }}-x64-osx-10.14.6.zip"
# The non-'4.8.7' URL will only work for '4.9.0' and above (such a version would break the above two URLs though, since they now build for `osx-10.16` and `glibc-2.35`)
MAC_ARM_Z3_URL: ${{ github.event.inputs.z3_version == '4.8.7' && 'https://github.com/viperproject/boogie-builder/raw/master/prebuilt_z3/z3-4.8.7-arm64-osx.zip' || format('https://github.com/Z3Prover/z3/releases/download/z3-{0}/z3-{0}-arm64-osx-11.zip', github.event.inputs.z3_version) }}
# we fake a ternary operator `a ? b : c` by using `a && b || c` as mentioned here:
# https://github.com/actions/runner/issues/409
WIN_BOOGIE_URL: ${{ github.event.inputs.boogie_tag_name == 'latest' && 'https://github.com/viperproject/boogie-builder/releases/latest/download/boogie-win.zip' || format('https://github.com/viperproject/boogie-builder/releases/download/{0}/boogie-win.zip', github.event.inputs.boogie_tag_name) }}
LINUX_BOOGIE_URL: ${{ github.event.inputs.boogie_tag_name == 'latest' && 'https://github.com/viperproject/boogie-builder/releases/latest/download/boogie-linux.zip' || format('https://github.com/viperproject/boogie-builder/releases/download/{0}/boogie-linux.zip', github.event.inputs.boogie_tag_name) }}
MAC_BOOGIE_URL: ${{ github.event.inputs.boogie_tag_name == 'latest' && 'https://github.com/viperproject/boogie-builder/releases/latest/download/boogie-osx.zip' || format('https://github.com/viperproject/boogie-builder/releases/download/{0}/boogie-osx.zip', github.event.inputs.boogie_tag_name) }}
MAC_ARM_BOOGIE_URL: ${{ github.event.inputs.boogie_tag_name == 'latest' && 'https://github.com/viperproject/boogie-builder/releases/latest/download/boogie-osx-arm.zip' || format('https://github.com/viperproject/boogie-builder/releases/download/{0}/boogie-osx-arm.zip', github.event.inputs.boogie_tag_name) }}
VIPER_IDE_DEPS_REF: "master"
steps:
- name: Install prerequisites
run: sudo apt-get install curl zip unzip
- name: Create ViperTools folders
run: |
mkdir ViperToolsWin
mkdir ViperToolsLinux
mkdir ViperToolsMac
mkdir ViperToolsMacARM
- name: Clone ViperTools template
uses: actions/checkout@v3
with:
repository: viperproject/viper-ide-deps
ref: ${{ env.VIPER_IDE_DEPS_REF }}
path: template
- name: Remove .git folder from template and use template
run: |
rm -r template/.git
cp -r template/* ViperToolsWin
cp -r template/* ViperToolsLinux
cp -r template/* ViperToolsMac
cp -r template/* ViperToolsMacARM
- name: Download ViperServer fat JAR
run: curl -L --silent --show-error --fail ${{ env.VIPERSERVER_URL }} --output viperserver.jar
- name: Copy ViperServer fat JAR to ViperTools
run: |
cp viperserver.jar ViperToolsWin/backends
cp viperserver.jar ViperToolsLinux/backends
cp viperserver.jar ViperToolsMac/backends
cp viperserver.jar ViperToolsMacARM/backends
- name: Download Z3
run: |
curl --fail --silent --show-error -L ${{ env.WIN_Z3_URL }} --output z3-win.zip
curl --fail --silent --show-error -L ${{ env.LINUX_Z3_URL }} --output z3-linux.zip
curl --fail --silent --show-error -L ${{ env.MAC_Z3_URL }} --output z3-mac.zip
curl --fail --silent --show-error -L ${{ env.MAC_ARM_Z3_URL }} --output z3-mac-arm.zip
- name: Unzip Z3 and copy Z3
run: |
unzip z3-win.zip -d z3-win
unzip z3-linux.zip -d z3-linux
unzip z3-mac.zip -d z3-mac
unzip z3-mac-arm.zip -d z3-mac-arm
mkdir -p ViperToolsWin/z3/bin && cp $(find z3-win -name bin -type d)/z3.exe ViperToolsWin/z3/bin
mkdir -p ViperToolsLinux/z3/bin && cp $(find z3-linux -name bin -type d)/z3 ViperToolsLinux/z3/bin
mkdir -p ViperToolsMac/z3/bin && cp $(find z3-mac -name bin -type d)/z3 ViperToolsMac/z3/bin
mkdir -p ViperToolsMacARM/z3/bin && cp $(find z3-mac-arm -name bin -type d)/z3 ViperToolsMacARM/z3/bin
- name: Download Boogie
run: |
curl --fail --silent --show-error -L ${{ env.WIN_BOOGIE_URL }} --output boogie-win.zip
curl --fail --silent --show-error -L ${{ env.LINUX_BOOGIE_URL }} --output boogie-linux.zip
curl --fail --silent --show-error -L ${{ env.MAC_BOOGIE_URL }} --output boogie-mac.zip
curl --fail --silent --show-error -L ${{ env.MAC_ARM_BOOGIE_URL }} --output boogie-mac-arm.zip
- name: Unzip Boogie and copy Boogie
run: |
unzip boogie-win.zip -d boogie-win
unzip boogie-linux.zip -d boogie-linux
unzip boogie-mac.zip -d boogie-mac
unzip boogie-mac-arm.zip -d boogie-mac-arm
mkdir -p ViperToolsWin/boogie && cp -r boogie-win/binaries-win ViperToolsWin/boogie/Binaries
mkdir -p ViperToolsLinux/boogie && cp -r boogie-linux/binaries-linux ViperToolsLinux/boogie/Binaries
mkdir -p ViperToolsMac/boogie && cp -r boogie-mac/binaries-osx ViperToolsMac/boogie/Binaries
mkdir -p ViperToolsMacARM/boogie && cp -r boogie-mac-arm/binaries-osx-arm ViperToolsMacARM/boogie/Binaries
- name: Create folder to store all ViperTools platform zip files
run: mkdir deploy
# note that we change into the tool folder to zip it. This avoids including the parent folder in the zip
- name: Zip ViperTools for Windows
run: zip -r ../deploy/ViperToolsWin.zip ./*
working-directory: ViperToolsWin
- name: Zip ViperTools for Linux
run: zip -r ../deploy/ViperToolsLinux.zip ./*
working-directory: ViperToolsLinux
- name: Zip ViperTools for macOS Intel
run: zip -r ../deploy/ViperToolsMac.zip ./*
working-directory: ViperToolsMac
- name: Zip ViperTools for macOS ARM
run: zip -r ../deploy/ViperToolsMacARM.zip ./*
working-directory: ViperToolsMacARM
- name: Upload ViperTools zip files
uses: actions/upload-artifact@v3
with:
name: ViperTools
path: deploy
build-and-test:
name: build-and-test - ${{ matrix.os }}
needs: create-viper-tools
# make the dependency optional in the sense that this job should be executed whenever the dependency was successful or skipped:
if: ${{ always() && (contains(needs.create-viper-tools.result, 'success') || contains(needs.create-viper-tools.result, 'skipped')) }}
strategy:
# tests should not be stopped when they fail on one of the OSes:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
include:
- os: macos-latest
viper-tools-zip-file: "ViperToolsMac.zip"
- os: ubuntu-latest
viper-tools-zip-file: "ViperToolsLinux.zip"
- os: windows-latest
viper-tools-zip-file: "ViperToolsWin.zip"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Viper-IDE
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '16' # we use latest node instead of LTS 14 to have the same lockfile version as locally used
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- run: java --version
- name: Cache npm
uses: actions/cache@v3
with:
path: client/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# npm ci fails to clone GitHub repos referenced in package.json with recent node versions
# the following work around has been proposed here: https://github.com/actions/setup-node/issues/214#issuecomment-810829250
- name: Reconfigure git to use HTTPS authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- run: npm ci --cache .npm --prefer-offline
working-directory: client
# there are two different scenarios in which different stuff should be tested:
# - regular changes to Viper-IDE: the normal test configuration should be used, which tests against the latest stable and
# nightly ViperTool releases. Any change to the Viper-IDE have ensure compatability
# - before releasing Viper-IDE together with some ViperTools, Viper-IDE has to be tested against the latest stable and
# nightly ViperTool releases AND the ViperTools that should be released.
- name: Download ViperTools to test against (only downloading previously created ViperTools)
if: ${{ contains(needs.create-viper-tools.result, 'success') }}
uses: actions/download-artifact@v3
with:
name: ViperTools
path: client/ViperTools
- name: Setup ViperTools folder
if: ${{ fromJSON(env.TEST_LOCAL_ON_PUSH_PR) && !contains(needs.create-viper-tools.result, 'success') }}
run: mkdir -p client/ViperTools
- name: Download ViperTools to test against (only downloading ViperTools for PUSH and PR operations if configured accordingly)
if: ${{ fromJSON(env.TEST_LOCAL_ON_PUSH_PR) && !contains(needs.create-viper-tools.result, 'success') }}
run: curl --fail --silent --show-error -L ${{ env.TEST_LOCAL_ON_PUSH_PR_VIPERTOOLS_URL }}/${{ matrix.viper-tools-zip-file }} --output ${{ matrix.viper-tools-zip-file }}
working-directory: client/ViperTools
- name: Unzip ViperTools (non-windows)
if: ${{ !startsWith(matrix.os, 'windows') && (fromJSON(env.TEST_LOCAL_ON_PUSH_PR) || contains(needs.create-viper-tools.result, 'success')) }}
run: unzip ${{ matrix.viper-tools-zip-file }} -d ExtractedTools
working-directory: client/ViperTools
- name: Unzip ViperTools (windows)
if: ${{ startsWith(matrix.os, 'windows') && (fromJSON(env.TEST_LOCAL_ON_PUSH_PR) || contains(needs.create-viper-tools.result, 'success')) }}
run: powershell Expand-Archive -LiteralPath ${{ matrix.viper-tools-zip-file }} -DestinationPath ExtractedTools
working-directory: client/ViperTools
- name: Download ViperServer JAR (only downloading ViperTools for PUSH and PR operations if configured accordingly)
if: ${{ fromJSON(env.TEST_LOCAL_ON_PUSH_PR) && !contains(needs.create-viper-tools.result, 'success') }}
run: curl --fail --silent --show-error -L ${{ env.TEST_LOCAL_ON_PUSH_PR_VIPERSERVER_URL }} --output viperserver.jar
working-directory: client/ViperTools/ExtractedTools/backends
- name: Create path to extracted tools (non-windows)
if: ${{ !startsWith(matrix.os, 'windows') && (fromJSON(env.TEST_LOCAL_ON_PUSH_PR) || contains(needs.create-viper-tools.result, 'success')) }}
run: |
echo "EXTRACTED_TOOLS_PATH=${{ github.workspace }}/client/ViperTools/ExtractedTools" >> $GITHUB_ENV
shell: bash
- name: Create path to extracted tools (windows)
if: ${{ startsWith(matrix.os, 'windows') && (fromJSON(env.TEST_LOCAL_ON_PUSH_PR) || contains(needs.create-viper-tools.result, 'success')) }}
# replace all backslashes by double backslashes to properly escape them in the resulting JSON
run: |
PATH='EXTRACTED_TOOLS_PATH=${{ github.workspace }}\client\ViperTools\ExtractedTools'
echo ${PATH//'\'/'\\'} >> $GITHUB_ENV
shell: bash
- name: Create an additional test config
if: ${{ fromJSON(env.TEST_LOCAL_ON_PUSH_PR) || contains(needs.create-viper-tools.result, 'success') }}
run: |
mkdir -p client/src/test/data/settings
echo '{
"viperSettings.buildVersion": "Local",
"viperSettings.paths": {
"v": "674a514867b1",
"viperToolsPath": {
"windows": "${{ env.EXTRACTED_TOOLS_PATH }}",
"linux": "${{ env.EXTRACTED_TOOLS_PATH }}",
"mac": "${{ env.EXTRACTED_TOOLS_PATH }}"
}
},
"viperserver.trace.server": "verbose"
}' > client/src/test/data/settings/ci_local.json
shell: bash
- name: Get config content
if: ${{ fromJSON(env.TEST_LOCAL_ON_PUSH_PR) || contains(needs.create-viper-tools.result, 'success') }}
run: cat client/src/test/data/settings/ci_local.json
shell: bash
- name: Run tests (headless - non-ubuntu)
if: "!startsWith(matrix.os, 'ubuntu')"
run: npm test --full-trace
working-directory: client
env:
VIPER_IDE_LOG_DIR: ${{ github.workspace }}/client/logs
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests (headless - ubuntu only)
if: startsWith(matrix.os, 'ubuntu')
run: xvfb-run -a npm test --full-trace
working-directory: client
env:
VIPER_IDE_LOG_DIR: ${{ github.workspace }}/client/logs
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Viper-IDE log files
if: ${{ failure() || cancelled() }}
uses: actions/upload-artifact@v3
with:
name: TestLogs-${{ matrix.os }}
path: client/logs
- name: Clean 'dist' folder (ubuntu only)
if: startsWith(matrix.os, 'ubuntu')
run: npm run clean
working-directory: client
# `npm run package` resp. `@vscode/vsce` complains that it cannot find
# locate-java-home and vs-verification-toolbox dependencies (the two non-npm dependencies).
# this seems related to https://github.com/npm/cli/issues/791
# the current workaround is to `run npm install` first:
# this workaround is only necessary when using node 14
# - name: Run 'npm install' as a workaround to later being able to package Viper-IDE (ubuntu only)
# if: startsWith(matrix.os, 'ubuntu')
# run: npm install
# working-directory: client
- name: List all files that will be packaged (ubuntu only)
if: startsWith(matrix.os, 'ubuntu')
run: npx @vscode/vsce ls
working-directory: client
# use @vscode/vsce to package the extension into a vsix file.
# sets a special field in package.json to indicate that the package is not a pre-release (it's one
# by default)
- name: Package Viper-IDE extension (ubuntu & stable release only)
if: ${{ startsWith(matrix.os, 'ubuntu') && github.event.inputs.type == 'stable' }}
run: |
npm pkg set viper.prerelease=false --json
npm run package -- --out viper-ide.vsix
working-directory: client
- name: Package Viper-IDE extension (ubuntu & non-stable release only)
if: ${{ startsWith(matrix.os, 'ubuntu') && github.event.inputs.type != 'stable' }}
run: npm run package -- --out viper-ide.vsix --pre-release
working-directory: client
- name: Upload packaged Viper-IDE (ubuntu-only)
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v3
with:
name: viper-ide.vsix
path: client/viper-ide.vsix
create-release:
# this job creates a nightly release or stable draft-release and adds viper-ide.vsix and Viper Tools as release assets
if: github.event_name == 'workflow_dispatch'
needs: build-and-test
runs-on: ubuntu-latest
env:
VIPERSERVER_RELEASE_URL: "https://github.com/viperproject/viperserver/releases/${{ github.event.inputs.viperserver_tag_name }}"
Z3_RELEASE_URL: "https://github.com/Z3Prover/z3/releases/z3-${{ github.event.inputs.z3_version }}"
BOOGIE_RELEASE_URL: ${{ github.event.inputs.boogie_tag_name == 'latest' && 'https://github.com/viperproject/boogie-builder/releases' || format('https://github.com/viperproject/boogie-builder/releases/{0}', github.event.inputs.boogie_tag_name) }}
steps:
# we have to checkout the repo to read client/package.json later on:
- name: Checkout Viper-IDE
uses: actions/checkout@v3
- name: Download packaged Viper IDE
uses: actions/download-artifact@v3
with:
name: viper-ide.vsix
path: client
- name: Download ViperTools
uses: actions/download-artifact@v3
with:
name: ViperTools
path: deploy
- name: Create release tag
if: ${{ github.event.inputs.type != 'stable' && github.event.inputs.type != 'rc' }}
shell: bash
run: echo "TAG_NAME=$(date +v-%Y-%m-%d-%H%M)" >> $GITHUB_ENV
# use the following action if nightly releases should eventually be deleted
# - name: Create nightly release
# if: ${{ github.event.inputs.type != 'stable' && github.event.inputs.type != 'rc' }}
# id: create_nightly_release
# uses: viperproject/create-nightly-release@v1
# env:
# # This token is provided by Actions, you do not need to create your own token
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ env.TAG_NAME }}
# release_name: Nightly Release ${{ env.TAG_NAME }}
# body: Based on ViperServer release ${{ github.event.inputs.viperserver_tag_name }}
# keep_num: 1 # keep the previous nightly release such that there are always two
# because e.g. prusti-dev depends on the nightly releases and updates only twice a month to the
# latest version, nightly releases should be kept
- name: Create nightly release
if: ${{ github.event.inputs.type != 'stable' && github.event.inputs.type != 'rc' }}
id: create_nightly_release
uses: actions/create-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: Nightly Release ${{ env.TAG_NAME }}
body: |
Based on
- ViperServer release [`${{ github.event.inputs.viperserver_tag_name }}`](${{ env.VIPERSERVER_RELEASE_URL }})
- [Z3 `${{ github.event.inputs.z3_version }}`](${{ env.Z3_RELEASE_URL }})
- [Boogie release `${{ github.event.inputs.boogie_tag_name }}`](${{ env.BOOGIE_RELEASE_URL }})
draft: false
prerelease: true
- name: Store nightly release upload URL
if: ${{ github.event.inputs.type != 'stable' && github.event.inputs.type != 'rc' }}
shell: bash
run: echo "UPLOAD_URL=${{ steps.create_nightly_release.outputs.upload_url }}" >> $GITHUB_ENV
- name: Create stable draft-release
if: ${{ github.event.inputs.type == 'stable' || github.event.inputs.type == 'rc' }}
id: create_stable_release
uses: actions/create-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag_name }}
release_name: ${{ github.event.inputs.release_name }}
body: |
Based on
- ViperServer release [`${{ github.event.inputs.viperserver_tag_name }}`](${{ env.VIPERSERVER_RELEASE_URL }})
- [Z3 `${{ github.event.inputs.z3_version }}`](${{ env.Z3_RELEASE_URL }})
- [Boogie release `${{ github.event.inputs.boogie_tag_name }}`](${{ env.BOOGIE_RELEASE_URL }})
draft: true
prerelease: false
- name: Store stable release upload URL
if: ${{ github.event.inputs.type == 'stable' || github.event.inputs.type == 'rc' }}
shell: bash
run: echo "UPLOAD_URL=${{ steps.create_stable_release.outputs.upload_url }}" >> $GITHUB_ENV
- name: Upload packaged Viper IDE
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: client/viper-ide.vsix
asset_name: viper-ide.vsix
asset_content_type: application/octet-stream
- name: Upload ViperTools for Windows
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: deploy/ViperToolsWin.zip
asset_name: ViperToolsWin.zip
asset_content_type: application/zip
- name: Upload ViperTools for Ubuntu
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: deploy/ViperToolsLinux.zip
asset_name: ViperToolsLinux.zip
asset_content_type: application/zip
- name: Upload ViperTools for macOS Intel
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: deploy/ViperToolsMac.zip
asset_name: ViperToolsMac.zip
asset_content_type: application/zip
- name: Upload ViperTools for macOS ARM
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: deploy/ViperToolsMacARM.zip
asset_name: ViperToolsMacARM.zip
asset_content_type: application/zip
# compare version in client/package.json with last published version on
# VS Marketplace and deploy this version if newer.
# credits go to @fpoli!
- name: Obtain version information
run: |
VSCE_OUTPUT="$(
npx @vscode/vsce show viper-admin.viper --json
)"
if [[ $(echo $VSCE_OUTPUT | grep --fixed-strings --line-regexp undefined) ]]; then
LAST_PUBLISHED_VERSION="0"
else
LAST_PUBLISHED_VERSION="$(
echo $VSCE_OUTPUT | jq '.versions[0].version' --raw-output
)"
fi
CURRENT_VERSION="$(
cat client/package.json | jq '.version' --raw-output
)"
echo "LAST_PUBLISHED_VERSION=$LAST_PUBLISHED_VERSION" >> $GITHUB_ENV
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
# publish 'stable' releases (release-candidates will be released as pre-releases below)
- name: Publish the extension to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
if: ${{ github.event.inputs.type == 'stable' && env.CURRENT_VERSION != env.LAST_PUBLISHED_VERSION }}
with:
pat: ${{ secrets.VSCE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: client/viper-ide.vsix
packagePath: ''
- name: Publish the extension to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v1
if: ${{ github.event.inputs.type == 'stable' && env.CURRENT_VERSION != env.LAST_PUBLISHED_VERSION }}
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
registryUrl: https://open-vsx.org
extensionFile: client/viper-ide.vsix
packagePath: ''
# publish 'rc' releases as pre-releases
- name: Publish the extension to Visual Studio Marketplace (as pre-release)
uses: HaaLeo/publish-vscode-extension@v1
if: ${{ github.event.inputs.type == 'rc' && env.CURRENT_VERSION != env.LAST_PUBLISHED_VERSION }}
with:
pat: ${{ secrets.VSCE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: client/viper-ide.vsix
packagePath: ''
preRelease: true