Skip to content

Commit

Permalink
fix: Auto release on action (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 17, 2022
1 parent 7191f53 commit eb1655e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 52 deletions.
51 changes: 13 additions & 38 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,21 @@
# 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
branches: [ master ]

pull_request:
branches:
- main
- master
branches: [ 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]
workflow_dispatch: {}

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

- name: Continuous Integration
run: npm run ci

- 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, macos-latest, windows-latest'
version: '14, 16, 18'
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class ClientGenerator {
/**
* create cluster client instance
*
* @param {...any} args arguments
* @return {Object} instance
*/
create(...args) {
Expand Down
20 changes: 6 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
"index.js"
],
"scripts": {
"autod": "autod",
"lint": "eslint . --ext .js",
"cov": "egg-bin cov --timeout 20000",
"test": "npm run lint && npm run test-local",
"test-local": "egg-bin test",
"pkgfiles": "egg-bin pkgfiles --check",
"ci": "npm run autod -- --check && npm run pkgfiles && npm run lint && npm run cov",
"ci": "npm run lint && npm run cov",
"contributors": "contributors -f plain -o AUTHORS"
},
"repository": {
Expand Down Expand Up @@ -47,26 +45,20 @@
},
"devDependencies": {
"address": "^1.0.3",
"autod": "^3.0.1",
"await-event": "^2.1.0",
"coffee": "^5.2.1",
"contributors": "^0.5.1",
"detect-port": "^1.3.0",
"egg-bin": "^4.11.0",
"egg-ci": "^2.2.0",
"egg-mock": "^3.21.0",
"eslint": "^5.14.1",
"eslint-config-egg": "^7.1.0",
"egg-bin": "^5.6.1",
"egg-mock": "^5.4.0",
"eslint": "^8.30.0",
"eslint-config-egg": "^12.1.0",
"mm": "^2.4.1",
"mz-modules": "^2.1.0",
"pedding": "^1.1.0",
"spy": "^1.0.0",
"webstorm-disable-index": "^1.2.0"
"spy": "^1.0.0"
},
"engines": {
"node": ">=14.0.0"
},
"ci": {
"version": "14, 16, 18"
}
}

0 comments on commit eb1655e

Please sign in to comment.