-
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (57 loc) · 1.82 KB
/
release.yml
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
name: Create Release
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Extract Version
id: version_step
run: |
echo "version=${GITHUB_REF#$"refs/tags/"}" >> $GITHUB_OUTPUT
- name: Print Version
run: |
echo ${{ steps.version_step.outputs.version }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Generate Release Notes from Commits
id: release_notes
run: |
echo "release_notes=$(git log --oneline $(git describe --tags --abbrev=0)..HEAD)" >> $GITHUB_OUTPUT
- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ steps.version_step.outputs.version }}
- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: "Update CHANGELOG for release ${{ steps.version_step.outputs.version }}"
file_pattern: CHANGELOG.md
- name: Update package.json version
uses: restackio/[email protected]
with:
file: package.json
fields: '{"version": "${{ steps.version_step.outputs.version }}"}'
- name: Package VSCode extension
run: |
npm run compile
npm run package-extension
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
files: |
./*.vsix
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}