-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (73 loc) · 2.21 KB
/
release.yml
File metadata and controls
88 lines (73 loc) · 2.21 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
# agent-pmo:5547fd2
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- run: npm ci
- name: Set package.json version from tag
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version
- name: Build VSIX
run: npm run package
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: commandtree-vsix
path: "*.vsix"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: "*.vsix"
generate_release_notes: true
post-release:
name: Update version & deploy site
needs: release
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
actions: write
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Update package.json version
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git commit -m "chore: bump version to ${{ steps.version.outputs.version }}"
git push
- name: Trigger website deploy
uses: actions/github-script@v7
with:
script: |
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'deploy-pages.yml',
ref: 'main',
});