mirror of
https://github.com/rive-app/rive-react.git
synced 2026-03-13 08:22:30 +08:00
59 lines
2.0 KiB
YAML
59 lines
2.0 KiB
YAML
name: Publish to NPM
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
major:
|
|
description: 'Major'
|
|
type: boolean
|
|
default: false
|
|
minor:
|
|
description: 'Minor'
|
|
type: boolean
|
|
default: false
|
|
jobs:
|
|
publish_job:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Git config
|
|
run: |
|
|
git config --local user.email 'hello@rive.app'
|
|
git config --local user.name ${{ github.actor }}
|
|
- name: Authenticate with registry
|
|
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: '16.x'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
- name: Install Modules
|
|
run: npm install
|
|
- name: Run type check
|
|
run: npm run types:check
|
|
- name: Run Linter
|
|
run: npm run lint
|
|
- name: Run Tests
|
|
run: npm test
|
|
- if: ${{ inputs.major == true }}
|
|
name: Major Release - Bump version number, update changelog, push and tag
|
|
run: npm run release:major
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
|
|
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
- if: ${{inputs.major == false && inputs.minor == true}}
|
|
name: Minor release - Bump version number, update changelog, push and tag
|
|
run: npm run release:minor
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
|
|
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
- if: ${{inputs.major == false && inputs.minor == false}}
|
|
name: Patch release - Bump version number, update changelog, push and tag
|
|
run: npm run release:patch
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
|
|
PAT_GITHUB: ${{ secrets.PAT_GITHUB }}
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|