Skip to content

Commit

Permalink
change release
Browse files Browse the repository at this point in the history
  • Loading branch information
lc-cn committed Feb 20, 2024
1 parent 837f91c commit b1c231b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 27 deletions.
46 changes: 19 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
name: Release and Publish
name: Release And Publish

on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 20.x
uses: actions/setup-node@v3
with:
release-type: node
package-name: zhin
# Checkout
- uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
# Setup node
- uses: actions/setup-node@v3
node-version: 20.x
- name: Install Dependencies
run: pnpm install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
# Install dependencies
- run: npm install
if: ${{ steps.release.outputs.release_created }}
# Build output
- run: npm run build
if: ${{ steps.release.outputs.release_created }}
# Publish to npm
- run: npm run pub
publish: npm run release
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"build": "node ./scripts/build.js",
"clean": "node ./scripts/clean.js",
"pub": "node ./scripts/publish.js",
"release": "npm run build && npm run pub",
"docs:dev": "vitepress dev docs --port 5566",
"docs:build": "vitepress build docs",
"docs:serve": "vitepress serve docs"
Expand Down

0 comments on commit b1c231b

Please sign in to comment.