Skip to content

Commit

Permalink
feat: release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
haiweilian committed Sep 7, 2022
1 parent 6c40aeb commit f9adc4a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# https://docs.github.com/en/actions/using-workflows/about-workflows
name: Release

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Checkout Repo
uses: actions/checkout@v2

# https://github.com/actions/setup-node
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x

# https://github.com/pnpm/action-setup
- name: Setup Pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x

# https://pnpm.io/zh/cli/install#--frozen-lockfile
- name: Install Dependencies
run: pnpm install --frozen-lockfile

# https://github.com/changesets/action
- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
publish: pnpm release
version: pnpm changeset version
commit: 'chore: version packages'
env:
NPM_TOKEN: ${{ secrets.AUTOMATION_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PUBLIC_GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"description": "Vue components examples.",
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview --port 4173",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lint:lint-staged": "lint-staged",
"lint:eslint": "eslint --fix --cache \"**/*.{js,jsx,ts,tsx,vue}\"",
"lint:stylelint": "stylelint --fix --cache \"**/*.{css,scss,less,styl,vue}\"",
"lint:prettier": "prettier --write \"**/*.{css,scss,less,styl,js,jsx,ts,tsx,vue}\""
"lint:prettier": "prettier --write \"**/*.{css,scss,less,styl,js,jsx,ts,tsx,vue}\"",
"release": "pnpm --recursive --stream build && changeset publish"
},
"dependencies": {
"@bfehub/vlib-ui": "workspace:^1.0.0",
Expand Down
9 changes: 9 additions & 0 deletions packages/vlib-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage"
},
"files": [
"es",
"lib",
"dist",
"global.d.ts"
],
"publishConfig": {
"access": "public"
},
"peerDependencies": {
"vant": "^3.5.0",
"vue": "^3.2.0"
Expand Down

0 comments on commit f9adc4a

Please sign in to comment.