-
Notifications
You must be signed in to change notification settings - Fork 62
48 lines (40 loc) · 1.42 KB
/
publish-release.yaml
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
name: Publish Release
on:
release:
types: [published]
jobs:
publish-release:
name: Publish Release
runs-on: ubuntu-latest
steps:
- name: Setup Node.js Environment
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Install npm
run: npm install -g npm@8.19.4
- name: Run node-gyp bug workaround script
run: |
curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh
- name: Install VSCode publishing dependencies
run: npm install -g vsce
- name: Download release assets
run: |
filename=$(basename -- "$ASSET_URL")
extension="${filename##*.}"
if [[ $extension != "vsix" ]]; then
echo "Wrong asset extension ${extension} in ${ASSET_URL}"
exit 1
else
wget -O ${filename} "${ASSET_URL}"
ls -al ${filename}
echo "VSIX_PATH=${filename}" >> $GITHUB_ENV
fi
env:
ASSET_URL: ${{ github.event.release.assets[0].browser_download_url }}
- name: Publish to marketplace
run: |
echo "Publishing ${VSIX_PATH} to marketplace"
npx vsce publish --packagePath "${VSIX_PATH}" --githubBranch main
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}