ci: reinstall between dependency-tier builds to propagate dists #16
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] | |
| concurrency: | |
| group: release | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun install --frozen-lockfile | |
| - name: Configure npm auth | |
| run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # build in dependency order. bun copies workspace deps into each | |
| # consumer's node_modules, so we reinstall between tiers to propagate | |
| # freshly-built dists down the dependency chain. | |
| - name: Build shared | |
| run: cd packages/shared && bunx tsc | |
| - run: bun install --frozen-lockfile | |
| - name: Build core | |
| run: cd packages/core && bunx tsup | |
| - run: bun install --frozen-lockfile | |
| - name: Build cli | |
| run: cd apps/cli && bunx tsup | |
| - run: bun install --frozen-lockfile | |
| - name: Create release pull request or publish | |
| uses: changesets/action@v1 | |
| with: | |
| publish: bunx changeset publish | |
| version: bunx changeset version | |
| commit: "chore: version packages" | |
| title: "chore: version packages" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |