tenseleyflow/dlm-vsc / a91745a

Browse files

Add tagged-release publish workflow for marketplace

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
a91745a421e2fa04036dbbb5b9e1204d6798950d
Parents
bf500eb
Tree
5ee8b2e

1 changed file

StatusFile+-
A .github/workflows/publish.yml 46 0
.github/workflows/publish.ymladded
@@ -0,0 +1,46 @@
1
+name: Publish
2
+
3
+on:
4
+  push:
5
+    tags:
6
+      - "v*"
7
+
8
+jobs:
9
+  publish:
10
+    name: build / test / publish
11
+    runs-on: ubuntu-latest
12
+    steps:
13
+      - uses: actions/checkout@v4
14
+
15
+      - name: Setup Node.js
16
+        uses: actions/setup-node@v4
17
+        with:
18
+          node-version: 20
19
+
20
+      - name: Install dependencies
21
+        run: npm ci
22
+
23
+      - name: Build extension
24
+        run: npm run build
25
+
26
+      - name: Compile tests
27
+        run: npx tsc -p test/tsconfig.json
28
+
29
+      - name: Run tests
30
+        uses: coactions/setup-xvfb@v1
31
+        with:
32
+          run: npm test
33
+
34
+      - name: Verify tag matches package.json version
35
+        run: |
36
+          tag="${GITHUB_REF#refs/tags/v}"
37
+          pkg=$(node -p "require('./package.json').version")
38
+          if [ "$tag" != "$pkg" ]; then
39
+            echo "Tag v$tag does not match package.json version $pkg"
40
+            exit 1
41
+          fi
42
+
43
+      - name: Publish to VSCode Marketplace
44
+        run: npx --yes @vscode/vsce publish -p "$VSCE_PAT"
45
+        env:
46
+          VSCE_PAT: ${{ secrets.VSCE_PAT }}