-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (96 loc) · 2.91 KB
/
Copy pathci.yml
File metadata and controls
99 lines (96 loc) · 2.91 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: CI
on:
release:
types: [published]
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
actions:
name: Check GH actions
runs-on: ubuntu-latest
permissions:
security-events: write # Required to upload SARIF results
steps:
- name: Clone repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Run zizmor
uses: zizmorcore/zizmor-action@5f14fd08f7cf1cb1609c1e344975f152c7ee938d # v0.5.6
test:
name: Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
- '26'
steps:
- name: Clone repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- run: corepack enable
- name: Install Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- run: yarn install --immutable
- run: yarn lint
- run: xvfb-run -a yarn test
- run: yarn vsce-package
- name: Validate package version matches git tag
if: github.event_name == 'release'
run: |
PACKAGE_VERSION=$(jq -r .version package.json)
if [ "$GITHUB_REF_NAME" != "v$PACKAGE_VERSION" ]; then
echo "Error: Tag version ($TAG_VERSION) does not match package.json version (v$PACKAGE_VERSION)"
exit 1
fi
- name: Upload VSIX
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: github.event_name == 'release'
with:
name: vsix
path: '*.vsix'
release:
if: github.event_name == 'release'
needs:
- actions
- test
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Clone repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Download VSIX
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: vsix
- name: Install Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 'lts/*'
- run: gh release upload "$GITHUB_REF_NAME" *.vsix
env:
GH_TOKEN: ${{ github.token }}
- run: npx @vscode/vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} -i *.vsix
check:
if: always()
needs:
- actions
- test
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}