Skip to content

Commit

Permalink
fix: auto release on action
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 17, 2022
1 parent 3e3416d commit 06961dc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 45 deletions.
52 changes: 12 additions & 40 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -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'
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
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -51,9 +50,5 @@
},
"engine": {
"node": ">= 14.0.0"
},
"ci": {
"version": "14, 16, 18",
"os": "linux"
}
}

0 comments on commit 06961dc

Please sign in to comment.