-
Notifications
You must be signed in to change notification settings - Fork 6
69 lines (67 loc) · 2.11 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
name: Publish release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build:
name: Package
strategy:
matrix:
include:
- vsce_target: win32-x64
ls_target: windows_amd64
npm_config_arch: x64
- vsce_target: win32-ia32
ls_target: windows_386
npm_config_arch: ia32
- vsce_target: win32-arm64
ls_target: windows_arm64
npm_config_arch: arm
- vsce_target: linux-x64
ls_target: linux_amd64
npm_config_arch: x64
- vsce_target: linux-arm64
ls_target: linux_arm64
npm_config_arch: arm64
- vsce_target: linux-armhf
ls_target: linux_arm
npm_config_arch: arm
- vsce_target: darwin-x64
ls_target: darwin_amd64
npm_config_arch: x64
- vsce_target: darwin-arm64
ls_target: darwin_arm64
npm_config_arch: arm64
runs-on: "ubuntu-latest"
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Read extension version
id: ext-version
run: |
content=`cat ./package.json | jq -r .version`
echo "::set-output name=content::$content"
- name: Ensure version matches with tag
if: ${{ github.ref != format('refs/tags/v{0}', steps.ext-version.outputs.content) }}
run: |
echo "Version mismatch!"
echo "Received ref: ${{ github.ref }}"
echo "Expected ref: refs/tags/v${{ steps.ext-version.outputs.content }}"
exit 1
- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
env:
npm_config_arch: ${{ matrix.npm_config_arch }}
- name: Package VSIX
run: npm run package -- --target=${{ matrix.vsce_target }}
env:
ls_target: ${{ matrix.ls_target }}
- name: Upload vsix as artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.vsce_target }}.vsix
path: "*.vsix"