-
-
Notifications
You must be signed in to change notification settings - Fork 10
62 lines (51 loc) · 1.69 KB
/
deploy.yaml
File metadata and controls
62 lines (51 loc) · 1.69 KB
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
name: Deploy
on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [main]
permissions:
contents: write
jobs:
publish-extension:
name: Publish to marketplace
runs-on: ubuntu-latest
environment: Production
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm --color ci
- name: Read version from package.json
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_ENV
- name: Check whether this version is already published
run: |
if git ls-remote --exit-code --tags origin "refs/tags/${{ env.version }}" > /dev/null; then
echo "Version ${{ env.version }} is already tagged."
exit 1
fi
- name: Publish to Open VSX Registry
id: publishToOpenVSX
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}
- name: Create Git tag
run: |
git tag "${{ env.version }}"
git push origin "${{ env.version }}"