NPM Publish #30
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: Publish | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Auto-increment current version by' | |
required: true | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
confirm: | |
description: 'Type `yes` to confirm to publish the package into the NPM registry and create a version commit and tag' | |
required: true | |
type: string | |
env: | |
FORCE_COLOR: 3 | |
jobs: | |
publish: | |
if: inputs.confirm == 'yes' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: echo "Version $VERSION | Confirm $CONFIRM" | |
env: | |
VERSION: ${{ inputs.version }} | |
CONFIRM: ${{ inputs.confirm }} | |
- run: yarn install --frozen-lockfile | |
- run: yarn make:4byte | |
- run: yarn compile | |
- run: yarn lint | |
- run: yarn test | |
- name: 'Set up git user to be able to commit, tag and push' | |
run: | | |
git config --global user.name 'acuarica' | |
git config --global user.email 'acuarica@users.noreply.github.com' | |
- name: 'Bump ${{ inputs.version }} in `package.json`, publish into NPM registry and commit and tag this release' | |
run: 'yarn publish --new-version ${{ inputs.version }} --message ":rocket: Bump new version v%s"' | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
- name: 'Push bumped `package.json` commit and newly created tag for this release' | |
run: | | |
git push | |
git push --tags |