Skip to content

publish manual

publish manual #6

name: publish manual
on: workflow_dispatch
jobs:
lerna:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup node
uses: actions/setup-node@v4
with:
node-version: '18'
- uses: pnpm/action-setup@v3
name: install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: install and prepare
run: pnpm i
- name: setup npm
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
- name: version and publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
if [ ${{ github.ref_name }} = master ]; then
npx --yes lerna version --no-private --ignore-scripts --exact --conventional-commits --conventional-graduate --create-release github --yes
npx --yes lerna publish from-git --ignore-scripts --yes
else
npx --yes lerna version --no-private --ignore-scripts --exact --conventional-commits --conventional-prerelease --preid beta --create-release github --yes
npx --yes lerna publish from-git --ignore-scripts --dist-tag beta --yes
fi