chore(): added docs, update presets #31
Workflow file for this run
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
name: Publish | |
# Inspired by: | |
# https://dev.to/xcanchal/automatic-versioning-in-a-lerna-monorepo-using-github-actions-4hij | |
# Problems: | |
# I tried to use github registry to publish public packages, | |
# but packages in github require auth to insall even if package is public. | |
# | |
# Lernau use npm for publish, even if npm client is set to yarn | |
# Publish only use npm as client and it ignore any config in yarnrc and npmClient settings | |
# | |
# Npm token will not be configured without registry-url set in setup-node | |
# To configure authToken for npm both registry-url and secret is needed. | |
# | |
# When publishing public package, publishConfig.access need to be stetup | |
# | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- master | |
jobs: | |
publish: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Use NodeJS 18" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install | |
run: yarn install | |
- name: Run build | |
run: yarn build | |
- name: Run test | |
run: yarn test | |
- name: Run lint | |
run: yarn lint | |
- name: "Version and publish" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "Set git user" | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor}}@users.noreply.github.com" | |
echo "Version" | |
yarn dlx lerna version \ | |
--conventional-commits \ | |
--no-private \ | |
--yes | |
echo "Publish" | |
yarn dlx lerna publish from-git \ | |
--loglevel debug \ | |
--yes |