chore: publish #419
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 new version | |
on: | |
push: | |
branches: | |
- main | |
- next | |
pull_request: | |
branches: | |
- main | |
- next | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Prepare | |
uses: ./.github/actions/checkout-install | |
- name: Test (unit) | |
run: pnpm test:unit | |
- name: Test Chromatic + Storybook | |
if: ${{ github.ref == 'refs/heads/main' || contains(github.event.head_commit.message, 'chromatic') }} | |
env: | |
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
run: pnpm chromatic | |
test-cli: | |
name: Test CLI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Prepare | |
uses: ./.github/actions/checkout-install | |
- name: Build (CLI) | |
run: pnpm cli:build | |
- name: Test (CLI) | |
run: pnpm test:cli | |
npm-publish: | |
name: npm-publish | |
runs-on: ubuntu-latest | |
if: | | |
${{ github.event.head_commit.message == 'chore: publish' | |
&& github.ref == 'refs/heads/main' }} | |
needs: | |
- test | |
- test-cli | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Prepare | |
uses: ./.github/actions/checkout-install | |
- name: Publish with Lerna | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
DOCS_NPM_TOKEN: ${{ secrets.DOCS_NPM_TOKEN }} | |
run: | | |
pnpm -C packages/cli build | |
pnpm config set //registry.npmjs.org/:_authToken ${NPM_AUTH_TOKEN} | |
pnpm publish --access public | |
pnpm config set //registry.npmjs.org/:_authToken ${DOCS_NPM_TOKEN} | |
pnpm publish packages/cli --access public | |
pnpm publish packages/storybook --access public | |
pnpm publish packages/vitepress --access public | |
pnpm publish packages/vitest --access public | |
#npx lerna publish -y from-git |