Skip to content

Commit

Permalink
ci: add changesets/action
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jun 19, 2023
1 parent b3e0055 commit d6ef546
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@vite-plugin-checker/runtime", "@playground/*"]
Expand Down
27 changes: 15 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Release

on:
push:
tags:
- 'vite-plugin-checker@*'
branches:
- main

env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jobs:
release:
Expand All @@ -23,25 +26,25 @@ jobs:
cache: pnpm
registry-url: 'https://registry.npmjs.org'

- run: npx changelogithub
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Install Dependencies
run: pnpm i

- name: PNPM build
- name: Prepare for Release
run: |
pnpm run format
pnpm run lint
pnpm run type-check
pnpm run clean
pnpm run build
pnpm run publint
cp README.md packages/vite-plugin-checker/README.md
- name: Publish to NPM
run: pnpm publish --filter vite-plugin-checker --no-git-checks
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
title: 'chore: next release'
publish: pnpm release
commit: 'release: publish'
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# https://github.com/changesets/action/issues/98#issuecomment-917292485
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

registry=https://registry.npmjs.org/
hoist=false
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"type-check": "pnpm -r --parallel --filter \"vite-plugin-checker\" exec tsc --noEmit",
"docs:dev": "pnpm --filter docs exec vitepress dev .",
"docs:build": "pnpm --filter docs exec vitepress build .",
"docs:serve": "pnpm --filter docs exec vitepress serve ."
"docs:serve": "pnpm --filter docs exec vitepress serve .",
"release": "cp README.md packages/vite-plugin-checker/README.md && changeset publish && git push --follow-tags"
},
"simple-git-hooks": {
"pre-commit": "pnpm exec lint-staged"
Expand Down

0 comments on commit d6ef546

Please sign in to comment.