-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (52 loc) · 1.98 KB
/
build-and-upload.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
name: Build and Upload
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types:
- created
jobs:
build_and_upload:
name: Build and Upload
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
env:
PRERELEASE: ${{ endsWith ( github.event.release.tag_name, '-prerelease' ) && '--pre-release' || '' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: "true"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Package extension
run: |
npm install -g @vscode/vsce
chmod +x bin/package.bash
bin/package.bash ${{ env.PRERELEASE }}
# move packaged extension from project root to own release folder
mkdir extension && mv *.vsix extension
env:
CI: true
- name: Upload artifact
uses: actions/upload-artifact@v3
if: success()
with:
name: packaged-extension
path: extension/
- name: Publish to Visual Studio Marketplace
if: success() && github.event_name == 'release'
run: |
chmod +x bin/validateRelease.sh
bin/validateRelease.sh ${{ github.event.release.tag_name }}
vsce publish -p ${{ secrets.VSCE_PUBLISH_TOKEN }} ${{ env.PRERELEASE }} --packagePath extension/*.vsix
- name: Publish to Open VSX Marketplace
if: success() && github.event_name == 'release'
run: |
npx ovsx publish extension/*.vsix -p ${{ secrets.OVSX_PUBLISHER_TOKEN }} ${{ env.PRERELEASE }}