-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.49 KB
/
Copy pathpublish.yml
File metadata and controls
57 lines (47 loc) · 1.49 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
name: Publish Extension
# main への push で patch バージョンを自動 bump し、VS Code Marketplace に publish する。
# bot のコミットは GITHUB_TOKEN によるものなので再度ワークフローを起こさない(無限ループ防止)。
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE'
- 'SECURITY.md'
- 'vsc-extension-quickstart.md'
- '.github/**'
permissions:
contents: write
concurrency:
group: publish-extension
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Bump patch version
id: bump
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
NEW_VERSION=$(npm version patch --no-git-tag-version)
echo "version=${NEW_VERSION#v}" >> "$GITHUB_OUTPUT"
git add package.json package-lock.json
git commit -m "chore: release ${NEW_VERSION}"
git push
- name: Publish to VS Code Marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: npx vsce publish
- name: Tag release
run: |
git tag "v${{ steps.bump.outputs.version }}"
git push origin "v${{ steps.bump.outputs.version }}"