fix: clarify husky prepare lifecycle #6
This file contains hidden or 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: "Release" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.ACTIONS_BRANCH_PROTECTION_BYPASS }} | |
| fetch-depth: 0 | |
| - name: Install pnpm with version specified in 'packageManager' | |
| uses: pnpm/action-setup@v4 | |
| - name: Install Node.js 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: "pnpm" | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(corepack 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 dependencies | |
| run: corepack pnpm install --frozen-lockfile | |
| - name: Run type check | |
| run: corepack pnpm typecheck | |
| - name: Run linter | |
| run: corepack pnpm lint | |
| - name: Run tests | |
| run: corepack pnpm test | |
| - name: Build package | |
| run: corepack pnpm build | |
| - name: Release | |
| env: | |
| COREPACK_ENABLE_AUTO_PIN: 0 | |
| COREPACK_ENABLE_STRICT: 0 | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: corepack pnpm release |