Skip to content

Release

Release #19

Workflow file for this run

name: publish
on:
workflow_dispatch:
inputs:
dry-run:
description: "Dry run"
required: true
type: boolean
default: false
bump-dependents-highest-as:
description: "Bump dependents highest as"
required: false
type: choice
options:
- major
- minor
- patch
default: "major"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Dependencies
run: yarn install --immutable --immutable-cache
- name: New version (dry run)
if: github.ref == 'refs/heads/main' && inputs.dry-run
run: yarn version --dry-run
- name: Configure Git user
if: github.ref == 'refs/heads/main' && !inputs.dry-run
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: New version
if: github.ref == 'refs/heads/main' && !inputs.dry-run
run: |
yarn version --create-release=github --bump-dependents-highest-as=${{ inputs.bump-dependents-highest-as }} -m 'chore: release %v [skip ci]'
env:
HUSKY: 0
GH_TOKEN: ${{ secrets.GH_TOKEN }}
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Publish to npm
run: |
if [ -z "$NODE_AUTH_TOKEN" ]; then
echo "Missing env variable NODE_AUTH_TOKEN"
exit 1
fi
echo >> ./.yarnrc.yml
echo "npmAuthToken: $NODE_AUTH_TOKEN" >> ./.yarnrc.yml
yarn workspaces foreach --no-private npm publish --tolerate-republish
if: github.ref == 'refs/heads/main' && !inputs.dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}