46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
name: Publish npm packages
|
|
|
|
on:
|
|
# For now auto-publish every change to the default branch
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
inputs:
|
|
bump:
|
|
description: How to increase the version
|
|
type: choice
|
|
default: patch
|
|
options:
|
|
- patch
|
|
- minor
|
|
- major
|
|
version:
|
|
description: The version to publish
|
|
type: string
|
|
default: ''
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
registry-url: 'https://npm.pkg.github.com'
|
|
scope: '@actions'
|
|
|
|
- run: npm ci
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- run: |
|
|
git config user.name github-actions
|
|
git config user.email [email protected]
|
|
|
|
- name: Publish packages
|
|
run: npx lerna publish ${{ inputs.version || inputs.bump || 'patch' }} --yes
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|