File tree 1 file changed +75
-0
lines changed
1 file changed +75
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : CI (compile, build and publish)
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - " master"
7
+ pull_request :
8
+ branches :
9
+ - " master"
10
+ release :
11
+ types :
12
+ - created
13
+
14
+ jobs :
15
+ test :
16
+ name : Run Tests
17
+ runs-on : ubuntu-latest
18
+
19
+ steps :
20
+ - name : Checkout code
21
+ uses : actions/checkout@v4
22
+
23
+ - name : Setup Node.js
24
+ uses : actions/setup-node@v4
25
+ with :
26
+ node-version : " 16"
27
+
28
+ - name : Install dependencies
29
+ run : npm install
30
+
31
+ - name : Compile the project
32
+ run : npm run compile
33
+
34
+ publish :
35
+ name : Package & Upload VSIX (Fake Publish in Fork, Real in Main)
36
+ runs-on : ubuntu-latest
37
+ needs : test
38
+ if : github.event_name == 'release'
39
+
40
+ steps :
41
+ - name : Checkout Repository
42
+ uses : actions/checkout@v4
43
+
44
+ - name : Install Node.js
45
+ uses : actions/setup-node@v4
46
+ with :
47
+ node-version : " 21"
48
+
49
+ - name : Install vsce (VS Code Extension Manager)
50
+ run : npm install -g @vscode/vsce
51
+
52
+ - name : Install Dependencies
53
+ run : npm install
54
+
55
+ - name : Build Extension
56
+ run : npm run compile
57
+
58
+ - name : Ensure dist directory exists
59
+ run : mkdir -p dist
60
+
61
+ - name : Package the VSIX file
62
+ run : vsce package -o dist/extension.vsix
63
+
64
+ - name : Upload VSIX Artifact
65
+ uses : actions/upload-artifact@v4
66
+ with :
67
+ name : vscode-extension
68
+ path : dist/*.vsix
69
+
70
+ - name : Publish to marketplace
71
+ run : |
72
+ if [ "${{ github.repository_owner }}" = "migtool" ]; then
73
+ echo "Publishing to VS Code Marketplace..."
74
+ vsce publish --pat ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
75
+ fi
You can’t perform that action at this time.
0 commit comments