generated from tjx666/awesome-vscode-extension-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.54 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
name: ♨️ Publish
run-name: Deploy ${{ github.ref_name}} @ ${{ github.sha}}
permissions:
contents: write
on:
# on tag push
push:
tags:
- 'v[0-9]+'
- 'v[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get tag from the event
id: get-tag
run: |
echo "GIT_TAG=${{github.ref_name}}" >> $GITHUB_OUTPUT
echo "::notice title=🏷️ Tag::${{ github.ref_name }} @ ${{ github.sha}}"
- name: Check package.json version is the same as the tag
id: check-version
run: |
if [ "v$(jq -r .version package.json)" != "${{ steps.get-tag.outputs.GIT_TAG }}" ]; then
echo "Version in package.json does not match the tag"
exit 1
fi
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Publish to Visual Studio Marketplace
run: pnpm run publish:vs-marketplace
env:
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}
# - name: Publish to Open VSX Registry
# run: pnpm run publish:open-vsx -p ${{ secrets.OPEN_VSX_TOKEN }}
- name: Github Release
run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}