Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Merge pull request #412 from Groww/develop #54

Merge pull request #412 from Groww/develop

Merge pull request #412 from Groww/develop #54

Workflow file for this run

name: UI-TOOLKIT-BUILD
on:
push:
branches: [ main ]
paths:
- 'packages/ui-toolkit/**'
env:
package_dir: 'packages'
package_name: 'ui-toolkit'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/setup-node@v2
with:
node-version: 16.14.0
registry-url: https://registry.npmjs.org/
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Check package version
id: cpv
uses: PostHog/check-package-version@v2
with:
path: '${{env.package_dir}}/${{env.package_name}}'
- name: Echo output
run: |
echo "Committed version: ${{ steps.cpv.outputs.committed-version }}"
echo "Published version: ${{ steps.cpv.outputs.published-version }}"
echo "Is new version: ${{ steps.cpv.outputs.is-new-version }}"
- run: |
git config --global user.email "[email protected]"
git config --global user.name "github-bot"
- run: |
pnpm install
pnpm run build --filter="@groww-tech/${{env.package_name}}"
- if: steps.cpv.outputs.is-new-version == 'true'
uses: ./.github/workflows/actions/pnpm_publish
with:
github_token: ${{secrets.GITHUB_TOKEN}}
npm_token: ${{secrets.NPM_TOKEN}}
path: './${{env.package_dir}}/${{env.package_name}}'