-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (49 loc) · 1.76 KB
/
Copy pathrelease.yml
File metadata and controls
60 lines (49 loc) · 1.76 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
# agent-pmo:74cf183
# Release Diffr on a v* tag: build → package one universal VSIX → publish to the
# VS Code Marketplace → attach it to the GitHub release. One sequential job.
# Pure-TS extension (no native binaries) → a single platform-agnostic VSIX.
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Package and publish
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Set version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Stamp version into every carrier
run: |
node scripts/stamp-release-version.mjs "$VERSION"
node scripts/verify-versions.mjs "$VERSION"
- name: Build and package universal VSIX
run: |
npm run build
npx vsce package --out "diffr-$VERSION.vsix"
- name: Publish to VS Code Marketplace
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_PAT }}
run: |
if [ -z "$VSCE_PAT" ]; then
echo "::error::VSCODE_MARKETPLACE_PAT not accessible. Add Diffr to the secret's allowed repositories under Org Settings → Secrets and variables → Actions."
exit 1
fi
npx vsce publish --packagePath "diffr-$VERSION.vsix" --allow-proposed-apis contribSourceControlHistoryItemMenu
- name: Attach VSIX to GitHub release
uses: softprops/action-gh-release@v2
with:
files: diffr-*.vsix
generate_release_notes: true
prerelease: ${{ contains(github.ref_name, '-') }}