Merge pull request #1279 from trycompai/mariano/release-force-dynamic #163
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: # Runs AFTER merge to release branch | |
| branches: | |
| - release | |
| permissions: | |
| contents: write # Allow check out and commit changes (version, changelog) | |
| issues: write # Allow commenting on issues/PRs | |
| pull-requests: write # Allow commenting on issues/PRs | |
| id-token: write # Needed for provenance | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: warp-ubuntu-latest-arm64-4x | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| # Fetch all history so semantic-release can analyze commits | |
| fetch-depth: 0 | |
| # Use a token that has permission to push to the repository | |
| # Either a PAT stored in GH_TOKEN or the default GITHUB_TOKEN | |
| token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' # Or your preferred Node.js version | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest # Optional: specify a bun version | |
| - name: Cache dependencies | |
| uses: WarpBuilds/cache@v1 | |
| with: | |
| path: | | |
| ~/.bun/install/cache | |
| node_modules | |
| apps/*/node_modules | |
| packages/*/node_modules | |
| key: ${{ runner.os }}-bun-release-${{ hashFiles('**/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun-release- | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile # Use --frozen-lockfile in CI | |
| - name: Build packages | |
| run: | | |
| echo "🔨 Building packages before release..." | |
| bun run -F @trycompai/db build | |
| bun run -F @trycompai/email build | |
| bun run -F @trycompai/kv build | |
| bun run -F @trycompai/ui build | |
| bun run -F @trycompai/analytics build | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Enable npm publishing | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| HUSKY: 0 # Skip husky hooks in CI | |
| run: npx semantic-release |