chore: add semantic-release

close #153
This commit is contained in:
Divlo
2021-07-23 23:15:52 +02:00
parent dff86f7bda
commit 9eedd5afbd
14 changed files with 7514 additions and 4137 deletions

25
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: 'Build'
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2'
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.3.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Build Package'
run: 'npm run build'

View File

@ -1,19 +0,0 @@
name: 'Lint Commit Messages'
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
commitlint:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2.3.4'
with:
fetch-depth: 0
- uses: 'wagoid/commitlint-github-action@v4.1.1'
with:
configFile: '.commitlintrc.json'

View File

@ -1,4 +1,4 @@
name: 'Node.js CI'
name: 'Lint'
on:
push:
@ -7,10 +7,10 @@ on:
branches: [master, develop]
jobs:
ci_app:
lint:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2.3.4'
- uses: 'actions/checkout@v2'
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.3.0'
@ -21,9 +21,7 @@ jobs:
- name: 'Install'
run: 'npm install'
- run: 'npm run lint:commit -- --to "${{ github.sha }}"'
- run: 'npm run lint:editorconfig'
- run: 'npm run lint:markdown'
- run: 'npm run lint'
- run: 'npm run build'
- run: 'npm test'
- uses: 'codecov/codecov-action@v2.0.1'
- run: 'npm run lint:typescript'

View File

@ -1,29 +1,29 @@
name: 'Node.js Package'
name: 'Release'
on:
release:
types: [created]
push:
branches: [master]
jobs:
publish-npm:
release:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2.3.4'
- uses: 'actions/checkout@v2'
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.3.0'
with:
node-version: '16.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org/'
- name: 'Install'
run: 'npm install'
- name: 'Build'
- name: 'Build Package'
run: 'npm run build'
- name: 'Publish'
run: 'npm publish --access public'
- name: 'Release'
run: 'npm run release'
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

28
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: 'Test'
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
jobs:
test:
runs-on: 'ubuntu-latest'
steps:
- uses: 'actions/checkout@v2'
- name: 'Use Node.js'
uses: 'actions/setup-node@v2.3.0'
with:
node-version: '16.x'
cache: 'npm'
- name: 'Install'
run: 'npm install'
- name: 'Test'
run: 'npm run test'
- name: 'Upload Coverage'
uses: 'codecov/codecov-action@v2.0.1'