Skip to content

Publish packages

Publish packages #6

Workflow file for this run

name: Publish packages
on:
workflow_dispatch:
branches:
- master
inputs:
increment:
description: Increment version type
default: patch
type: choice
options:
- patch
- minor
- major
commitlintConfig:
description: Publish commitlint-config
type: boolean
default: true
eslintConfig:
description: Publish eslint-config
type: boolean
default: true
prettierConfig:
description: Publish prettier-config
type: boolean
default: true
jobs:
publish:
name: Publish packages (${{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}}
if: inputs.commitlintConfig == true
name: Publish commitlint-config release
working-directory: packages/commitlint-config
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- run: bun run release --increment ${{inputs.increment}}
if: inputs.eslintConfig == true
name: Publish eslint-config release
working-directory: packages/eslint-config
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- run: bun run release --increment ${{inputs.increment}}
if: inputs.prettierConfig == true
name: Publish prettier-config release
working-directory: packages/prettier-config
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}