-
Notifications
You must be signed in to change notification settings - Fork 180
127 lines (115 loc) · 4.39 KB
/
deploy.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
name: Publish Extension release
permissions:
contents: write # for uploading release artifacts
on:
workflow_dispatch:
inputs:
deploy_type:
description: 'Deploy a stable or prerelease extension'
type: choice
required: true
default: stable
options:
- stable
- prerelease
langserver:
description: 'The terraform-ls version to use. If not specified will use version in package.json'
required: false
type: string
jobs:
build:
name: Package
strategy:
matrix:
include:
- vsce_target: web
ls_target: web_noop
npm_config_arch: x64
- 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@b4ffde65f46336ab88eb53be808477a3936bae11 # https://github.com/actions/checkout/releases/tag/v4.1.1
- name: Set prerelease in package.json
if: inputs.deploy_type == 'prerelease'
id: set-preview
run: |
./build/preview.sh
env:
LANGUAGE_SERVER_VERSION: ${{ github.event.inputs.langserver }}
- name: Setup Node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # https://github.com/actions/setup-node/releases/tag/v3.8.1
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
env:
npm_config_arch: ${{ matrix.npm_config_arch }}
ls_target: ${{ matrix.ls_target }}
- name: Package PreRelease VSIX
if: inputs.deploy_type == 'prerelease'
run: npm run package -- --githubBranch $GITHUB_REF_NAME --pre-release --target=${{ matrix.vsce_target }}
- name: Package Stable VSIX
if: inputs.deploy_type == 'stable'
run: npm run package -- --target=${{ matrix.vsce_target }}
- name: Upload vsix as artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # https://github.com/actions/upload-artifact/releases/tag/v3.1.3
with:
name: ${{ matrix.vsce_target }}
path: '*.vsix'
publish-pre-marketplace:
name: Publish Prerelease to Marketplace
runs-on: ubuntu-latest
needs: build
if: success() && inputs.deploy_type == 'prerelease'
steps:
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # https://github.com/actions/download-artifact/releases/tag/v3.0.2
- name: Publish Prerelease to Marketplace
run: npx vsce publish --pre-release --no-git-tag-version --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
publish-stable-marketplace:
name: Publish Marketplace
runs-on: ubuntu-latest
needs: build
if: success() && inputs.deploy_type == 'stable'
steps:
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # https://github.com/actions/download-artifact/releases/tag/v3.0.2
- name: Publish Stable to Marketplace
run: npx vsce publish --no-git-tag-version --packagePath $(find . -iname *.vsix)
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
publish-stable-openvsx:
name: Publish OpenVSX
runs-on: ubuntu-latest
needs: build
if: success() && inputs.deploy_type == 'stable'
steps:
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # https://github.com/actions/download-artifact/releases/tag/v3.0.2
- name: Publish Stable to OpenVSX
run: npx ovsx publish --packagePath $(find . -iname *.vsix)
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}