-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.46 KB
/
release.yml
File metadata and controls
53 lines (44 loc) · 1.46 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
name: Release
on:
workflow_dispatch:
inputs:
overwrite:
description: Overwrite existing release if tag already exists
type: boolean
default: false
jobs:
release:
name: Package and Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Read package info
id: pkg
run: |
echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
echo "name=$(node -p "require('./package.json').name")" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Install dependencies
run: npm install
- name: Run checks
run: npm run ci
- name: Package extension
run: npx @vscode/vsce package --no-dependencies -o ${{ steps.pkg.outputs.name }}-${{ steps.pkg.outputs.version }}.vsix
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="v${{ steps.pkg.outputs.version }}"
if [[ "${{ inputs.overwrite }}" == "true" ]]; then
gh release delete "$TAG" --yes --cleanup-tag 2>/dev/null || true
fi
gh release create "$TAG" \
--title "$TAG" \
--generate-notes \
"${{ steps.pkg.outputs.name }}-${{ steps.pkg.outputs.version }}.vsix"