This repository has been archived by the owner on Dec 27, 2024. It is now read-only.
Update README.md #285
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ develop, master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x, 16.x, 17.x, 18.x, 19.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: npm ci | |
- run: npm run lint | |
- run: npm run lint:ts | |
- run: npm test | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage/lcov.info | |
flags: unittests | |
name: codecov-upload | |
fail_ci_if_error: true | |
publish: | |
if: ${{ github.ref == 'refs/heads/master' }} | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm install | |
- run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Generate changelog | |
id: changelog | |
uses: metcalfc/[email protected] | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get package version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@master | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.package-version.outputs.current-version }} | |
release_name: Release ${{ steps.package-version.outputs.current-version }} | |
body: | | |
${{ steps.changelog.outputs.changelog }} | |
draft: false | |
prerelease: false |