Skip to content

Publish package

Publish package #1

name: Publish package
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
jobs:
install:
name: Publish package
runs-on: macos-latest
permissions:
packages: write
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.increment}} != 'no-increment'
name: Publish ${{inputs.increment}} release
working-directory: packages/${{inputs.package}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}