-
Notifications
You must be signed in to change notification settings - Fork 31
46 lines (38 loc) · 1.22 KB
/
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
name: Publish Release
on:
push:
tags:
- "*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check that package.json is up-to-date
run: |
# this version has no v prefix, e.g. 1.0.0
VERSION_FROM_PACKAGE_JSON=$(jq -r '.version' package.json)
# the GITHUB_REF_NAME is the tag name, e.g. v1.0.0
VERSION_FROM_GITHUB_REF_NAME=${GITHUB_REF_NAME:1} # remove the v prefix
if [ "$VERSION_FROM_PACKAGE_JSON" = "$VERSION_FROM_GITHUB_REF_NAME" ]; then
echo "The versions match, proceeding to publish."
else
echo "Please update the version in package.json to match the tag."
exit 1
fi
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "14"
- name: Install dependencies
run: npm install
- name: Install vsce
run: npm install -g vsce
- name: Publish to marketplace
run: |
vsce publish \
--no-update-package-json \
--no-git-tag-version \
-p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} \
${GITHUB_REF_NAME:1}