Skip to content

Commit

Permalink
chore: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
sj817 committed Dec 9, 2024
1 parent 7a3a6b9 commit 0203fd5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/release-please.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release and Publish
name: ci
on:
push:
branches:
Expand All @@ -10,30 +10,35 @@ jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
- name: 发行版本
uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
default-branch: main
# Checkout
- uses: actions/checkout@v4
- name: 检出代码
uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
# Setup node
- uses: actions/setup-node@v3
- name: 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
if: ${{ steps.release.outputs.release_created }}
# Install dependencies
- run: npm install
if: ${{ steps.release.outputs.release_created }}
- name: 安装依赖
run: npm install
env:
NODE_AUTH_TOKEN: ${{ secrets.RELEASE }}
if: ${{ steps.release.outputs.release_created }}
# Build output
- run: npm run build:npm
- name: 构建
run: npm run build:npm
if: ${{ steps.release.outputs.release_created }}
# Publish to npm
- run: npm run pub
- name: 发布到 nom
run: npm run pub
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
- name: 同步 cnpm
run: npm run sync
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
"package.json"
],
"scripts": {
"build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json && npm run fix:all",
"build:npm": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json",
"fix:all": "eslint lib/**/*.js --fix && eslint lib/**/*.d.ts --fix",
"build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json",
"pub": "npm publish --access public",
"sort": "npx sort-package-json"
"sort": "npx sort-package-json",
"sync": "curl -X PUT \"https://registry-direct.npmmirror.com/-/package/@karinjs/puppeteer-core/syncs\""
},
"dependencies": {
"decompress": "4.2.1",
Expand Down

0 comments on commit 0203fd5

Please sign in to comment.