Release #59
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: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to release (e.g., 1.2.3)' | |
| required: true | |
| type: string | |
| pattern: '^[0-9]+\.[0-9]+\.[0-9]+$' | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org | |
| cache: 'pnpm' | |
| - run: pnpm install | |
| - name: Build z | |
| run: cd packages/z && pnpm build | |
| - name: Test z | |
| run: cd packages/z && pnpm test | |
| - name: Test nestjs-zod | |
| run: cd packages/nestjs-zod && pnpm test | |
| - name: Build nestjs-zod | |
| run: cd packages/nestjs-zod && pnpm build | |
| - name: Build example-dual-zods app | |
| run: cd packages/example-dual-zods && pnpm run build | |
| - name: Test example-dual-zods app | |
| run: cd packages/example-dual-zods && pnpm run test | |
| - name: Build example app | |
| run: cd packages/example && pnpm build | |
| - name: Test example app | |
| run: cd packages/example && pnpm test | |
| - name: Cache Playwright Browsers | |
| id: playwright-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('packages/example-dual-zods/package.json') }} | |
| restore-keys: | | |
| playwright-${{ runner.os }}- | |
| - name: Install Playwright Browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: cd packages/example-dual-zods && pnpm exec playwright install --with-deps | |
| - name: Test example-dual-zods app swagger | |
| run: | | |
| cd packages/example-dual-zods && pnpm run start & | |
| cd packages/example-dual-zods && pnpm run test:swagger | |
| - name: Extract version from release | |
| id: version-from-release | |
| if: github.event_name == 'release' | |
| uses: olegtarasov/get-tag@v2.1.3 | |
| with: | |
| tagRegex: 'v(.*)' | |
| - name: Set version from release | |
| uses: reedyuk/npm-version@1.1.1 | |
| with: | |
| version: ${{ github.event_name == 'release' && steps.version-from-release.outputs.tag || github.event.inputs.version }} | |
| package: 'packages/nestjs-zod' | |
| - name: Copy README from root of project to nestjs-zod | |
| run: | | |
| cp README.md packages/nestjs-zod | |
| sed -i 's/\/packages\/example/\.\.\/example/g' packages/nestjs-zod/README.md | |
| - name: Publish to NPM | |
| run: cd packages/nestjs-zod && npm publish |