Skip to content

Commit 75c77a5

Browse files
committed
Updated the workflow to use github actions for updating the release and publishing.
1 parent 2ae874d commit 75c77a5

File tree

2 files changed

+17
-31
lines changed

2 files changed

+17
-31
lines changed

.github/workflows/test_and_publish.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,44 +30,31 @@ jobs:
3030
run: npm test
3131

3232
release:
33-
name: Bump Version, Update Changelog, and Publish
33+
name: Create Github Release + Publish to Marketplace
3434
needs: tests
35-
if: |
36-
github.ref == 'refs/heads/master' &&
37-
github.actor == 'chrisdbeard'
35+
if: startswith(github.ref, 'refs/tags/v') && github.actor == 'chrisdbeard'
3836
runs-on: ubuntu-latest
3937

4038
steps:
4139
- uses: actions/checkout@v4
42-
with:
43-
token: ${{ secrets.GITHUB_TOKEN }}
4440

45-
- name: Set up Node.js
46-
uses: actions/setup-node@v4
41+
- uses: actions/setup-node@v4
4742
with:
4843
node-version: '20'
44+
cache: npm
4945

5046
- run: npm ci
5147

52-
- name: Bump version and update changelog
53-
run: npm run release
54-
55-
- name: Configure Git identity
56-
run: |
57-
git config --global user.name "github-actions[bot]"
58-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
59-
60-
- name: Commit version bump and changelog
61-
run: |
62-
git add package.json package-lock.json CHANGELOG.md
63-
git commit -m "chore(release): $(node -p "require('./package.json').version") [skip ci]" || echo "No changes to commit"
64-
65-
- name: Create Git tag
66-
run: |
67-
VERSION=$(node -p "require('./package.json').version")
68-
git tag "v$VERSION"
69-
git push origin master --follow-tags
70-
git push origin "v$VERSION"
71-
72-
- name: Publish to VSCode Marketplace
73-
run: npx vsce publish -p ${{ secrets.VS_MARKETPLACE_TOKEN }}
48+
- name: Github Release
49+
uses: softprops/action-gh-release@v1
50+
with:
51+
generate_release_notes: true
52+
body: |
53+
# Summary
54+
See the [CHANGELOG.md]((https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md))
55+
name: $ {{ github.ref_name }}
56+
57+
- name: Publish to Visual Studio Marketplace
58+
uses: HaaLeo/publish-vscode-extension@v1
59+
with:
60+
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
]
6060
},
6161
"scripts": {
62-
"release": "standard-version",
6362
"lint": "eslint .",
6463
"pretest": "npm run lint",
6564
"test": "mocha \"./src/test/*.test.js\""

0 commit comments

Comments
 (0)