From e74df4885a74fa99e935323a858e7f6c4447cc97 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sun, 18 Dec 2022 00:05:23 +0800 Subject: [PATCH] fix: auto release on action (#22) --- .github/workflows/nodejs.yml | 52 ++++++++--------------------------- .github/workflows/release.yml | 19 +++++++++++++ package.json | 5 ---- 3 files changed, 31 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 53c32bc..22a8662 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,46 +1,18 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Node.js CI +name: CI on: push: - branches: - - main - - master - pull_request: - branches: - - main - - master - schedule: - - cron: '0 2 * * *' - -jobs: - build: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - node-version: [14, 16, 18] - os: [ubuntu-latest] + branches: [ master ] - steps: - - name: Checkout Git Source - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Install Dependencies - run: npm i + pull_request: + branches: [ master ] - - name: Continuous Integration - run: npm run ci + workflow_dispatch: {} - - name: Code Coverage - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} +jobs: + Job: + name: Node.js + uses: artusjs/github-actions/.github/workflows/node-test.yml@v1 + with: + os: 'ubuntu-latest' + version: '14, 16, 18' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c6cc6c8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Release + +on: + # 合并后自动发布 + push: + branches: [ master ] + + # 手动发布 + workflow_dispatch: {} + +jobs: + release: + name: Node.js + uses: artusjs/github-actions/.github/workflows/node-release.yml@v1 + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GIT_TOKEN: ${{ secrets.GIT_TOKEN }} + with: + checkTest: false diff --git a/package.json b/package.json index f117859..6979214 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "@types/node": "^14.18.34", "co-mocha": "^1.2.2", "egg-bin": "^5.5.0", - "egg-ci": "^2.2.0", "eslint": "^8.29.0", "eslint-config-egg": "^12.1.0", "git-contributor": "^1.1.0", @@ -51,9 +50,5 @@ }, "engine": { "node": ">= 14.0.0" - }, - "ci": { - "version": "14, 16, 18", - "os": "linux" } }