Skip to content

Publish

Publish #30

Workflow file for this run

name: Publish
on:
workflow_dispatch:
push:
branches: [master]
paths:
- 'src/*.js'
- 'types/*.d.ts'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout to repository
uses: actions/checkout@v2
- name: Use NodeJS
uses: actions/setup-node@v1
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Linting
run: yarn run lint
- name: Testing
run: yarn run jest --collectCoverage
- uses: codecov/codecov-action@v3
with:
directory: ./coverage
- name: Generate changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v2
with:
github-token: ${{ secrets.RELEASE_TOKEN }}
git-message: 'chore(release): {version}'
output-file: 'CHANGELOG.md'
release-count: '0'
package-json: './package.json'
- name: Publish to npm
run: yarn run publish-lib
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
- name: Rollback release
if: failure() && steps.changelog.outputs.id != ''
uses: author/action-rollback@stable
with:
id: ${{ steps.changelog.outputs.id }}
tag: ${{ steps.changelog.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Automatic Revert
if: failure()
uses: srt32/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}