diff --git a/.github/workflows/release-please.yml b/.github/workflows/ci.yml similarity index 52% rename from .github/workflows/release-please.yml rename to .github/workflows/ci.yml index f8c7c92..ed93773 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Release and Publish +name: ci on: push: branches: @@ -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 }} \ No newline at end of file diff --git a/package.json b/package.json index 1cddfe8..7351377 100644 --- a/package.json +++ b/package.json @@ -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",