diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index a030a61..5c216b8 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, windows-latest, macos-latest] + branches: [ master ] - steps: - - name: Checkout Git Source - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - 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@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} +jobs: + Job: + name: Node.js + uses: artusjs/github-actions/.github/workflows/node-test.yml@v1 + with: + os: 'ubuntu-latest, macos-latest, windows-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 9a427d7..38a519c 100644 --- a/package.json +++ b/package.json @@ -8,12 +8,11 @@ ], "scripts": { "contributor": "git-contributor", - "pkgfiles": "egg-bin pkgfiles --check", "lint": "eslint --ext .js . --fix", "test": "npm run lint && npm run test-local", "test-local": "egg-bin test", "cov": "egg-bin cov", - "ci": "npm run pkgfiles && npm run lint && npm run cov" + "ci": "npm run lint && npm run cov" }, "repository": { "type": "git", @@ -31,12 +30,11 @@ }, "homepage": "https://github.com/node-modules/diskstore#readme", "dependencies": { - "sdk-base": "^3.6.0" + "sdk-base": "^4.2.0" }, "devDependencies": { "coffee": "^5.4.0", "egg-bin": "^5.1.0", - "egg-ci": "2", "eslint": "^8.16.0", "eslint-config-egg": "12", "git-contributor": "^1.1.0", @@ -44,8 +42,5 @@ }, "engines": { "node": ">= 14.0.0" - }, - "ci": { - "version": "14, 16, 18" } }