Skip to content

Commit

Permalink
Merge pull request #2 from phondani0/dev
Browse files Browse the repository at this point in the history
feat: auto update package.json version after new release
  • Loading branch information
phondani0 authored Aug 11, 2024
2 parents 2b8c9de + b9289ec commit cb4af99
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 218 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release & Publish to VSCode Marketplace
on:
push:
branches:
- dev
- main

jobs:
release:
Expand All @@ -12,18 +12,22 @@ jobs:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install
run: npm ci

- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
GIT_AUTHOR_NAME: phondani0
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: phondani0
GIT_COMMITTER_EMAIL: [email protected]
VSCE_TOKEN: ${{ secrets.VSCODE_PUBLISHER_TOKEN }}
run: npx semantic-release
run: npx semantic-release --debug
27 changes: 20 additions & 7 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
branches:
- dev
- main

plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/npm'
- '@semantic-release/git'
- '@semantic-release/github'

prepare:
- path: "@semantic-release/exec"
cmd: "npm --no-auth --no-git-tag-version version ${nextRelease.version}"
cmd: "vsce package --out vite-serve-${nextRelease.version}.vsix"

- path: "@semantic-release/exec"
cmd: "vsce package"
cmd: "npm --git-tag-version=false version ${nextRelease.version}"

publish: false
- path: "@semantic-release/exec"
cmd: "git add package.json && git status && git commit -m 'chore: update package.json version to ${nextRelease.version}'"

npmPublish: false

# assets:
# - "vite-serve-*.vsix"

success:
# - path: "@semantic-release/exec"
# cmd: "vsce publish --pat $VSCE_TOKEN"

- path: "@semantic-release/exec"
cmd: "vsce publish --pat $VSCE_TOKEN"
- path: "@semantic-release/exec"
cmd: "git push && git push --tags"
cmd: "git pull && git push && git push --tags"
Loading

0 comments on commit cb4af99

Please sign in to comment.