-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (74 loc) · 2.74 KB
/
Copy pathpublish-vscode-extension.yml
File metadata and controls
88 lines (74 loc) · 2.74 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
name: Publish VS Code extension
on:
workflow_dispatch:
inputs:
version:
description: Version to publish, such as 1.6.1
required: true
type: string
permissions:
contents: read
concurrency:
group: publish-vscode-extension
cancel-in-progress: false
jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
id-token: write
steps:
- name: Check out main
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: |
Tooling/package-lock.json
VS Code Extension/package-lock.json
- name: Check release version
env:
RELEASE_VERSION: ${{ inputs.version }}
shell: bash
run: |
node -e 'const version = process.env.RELEASE_VERSION; if (!/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.test(version)) { console.error(`Use a stable version such as 1.6.1; received: ${version}`); process.exit(1); }'
- name: Install build dependencies
run: |
npm ci --prefix Tooling
npm ci --prefix "VS Code Extension"
- name: Set extension version
env:
RELEASE_VERSION: ${{ inputs.version }}
run: npm version "$RELEASE_VERSION" --prefix "VS Code Extension" --no-git-tag-version --ignore-scripts --allow-same-version
- name: Build and test extension
run: |
node website/scripts/materialize-manifest.mjs
npm run verify --prefix "VS Code Extension"
- name: Package extension
env:
RELEASE_VERSION: ${{ inputs.version }}
working-directory: VS Code Extension
run: |
mkdir -p ../artifacts
npx --no-install vsce package --out "../artifacts/ser-${RELEASE_VERSION}.vsix"
- name: Save VSIX
uses: actions/upload-artifact@v4
with:
name: ser-vscode-${{ inputs.version }}
path: artifacts/ser-${{ inputs.version }}.vsix
if-no-files-found: error
- name: Publish to Visual Studio Marketplace
env:
RELEASE_VERSION: ${{ inputs.version }}
working-directory: VS Code Extension
run: npx --no-install vsce publish --oidc --packagePath "../artifacts/ser-${RELEASE_VERSION}.vsix"
- name: Write release summary
env:
RELEASE_VERSION: ${{ inputs.version }}
run: |
echo "### VS Code extension ${RELEASE_VERSION} published" >> "$GITHUB_STEP_SUMMARY"
echo "[Open the Marketplace listing](https://marketplace.visualstudio.com/items?itemName=ElektrykAndrzej.ser)" >> "$GITHUB_STEP_SUMMARY"