Publish package #8
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
on: | |
workflow_dispatch: | |
branches: | |
- master | |
inputs: | |
package: | |
description: Package name | |
required: true | |
type: choice | |
options: | |
- commitlint-config | |
- eslint-config | |
- prettier-config | |
increment: | |
description: Increment version type | |
default: patch | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
name: Publish package | |
jobs: | |
publish: | |
name: Publish ${{inputs.package}} package (${{inputs.increment}}) | |
runs-on: macos-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout | |
with: | |
ref: ${{github.event.ref}} | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
name: Setup node | |
with: | |
node-version: 18.14.2 | |
registry-url: https://registry.npmjs.org/ | |
- run: npm i bun -g | |
name: Install bun | |
- run: bun install --frozen-lockfile | |
name: Install dependencies | |
- run: | | |
echo "Bun version: $(bun -v)" | |
echo "NodeJS version: $(node -v)" | |
echo "NPM version: $(npm -v)" | |
name: Display versions | |
- run: bun run format | |
name: Format code | |
- run: bun run lint | |
name: Lint code | |
- run: bun run release --increment ${{inputs.increment}} | |
name: Publish ${{inputs.increment}} release | |
working-directory: packages/${{inputs.package}} | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |