fix: types #4
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: | |
| - "v*" | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build | |
| run: pnpm run build | |
| - name: Lint | |
| run: pnpm run lint | |
| - name: Typecheck | |
| run: pnpm run typecheck | |
| - name: Test | |
| run: pnpm run test | |
| publish: | |
| needs: build-and-test | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build | |
| run: pnpm run build | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Sync package versions | |
| run: | | |
| VERSION=${{ steps.version.outputs.VERSION }} | |
| echo "Setting all packages to version $VERSION" | |
| # Update version in all package.json files | |
| for pkg in packages/*/package.json; do | |
| jq --arg v "$VERSION" '.version = $v' "$pkg" > tmp.json && mv tmp.json "$pkg" | |
| echo "$pkg: $VERSION" | |
| done | |
| # Note: pnpm automatically replaces workspace:^ with ^VERSION during publish | |
| - name: Publish all packages | |
| run: pnpm -r publish --access public --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Create GitHub Release | |
| run: npx changelogithub | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |