| 1 | name: Snapshot |
| 2 | on: |
| 3 | push: |
| 4 | branches: [main] |
| 5 | pull_request: |
| 6 | branches: [main] |
| 7 | workflow_dispatch: |
| 8 | |
| 9 | concurrency: |
| 10 | group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | cancel-in-progress: true |
| 12 | |
| 13 | permissions: {} |
| 14 | |
| 15 | jobs: |
| 16 | approval-gate: |
| 17 | if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository |
| 18 | runs-on: namespace-profile-linux-small |
| 19 | environment: fork |
| 20 | steps: |
| 21 | - run: echo "Fork PR approved by maintainer." |
| 22 | |
| 23 | snapshot: |
| 24 | name: Snapshot |
| 25 | needs: [approval-gate] |
| 26 | if: >- |
| 27 | !cancelled() |
| 28 | && (needs.approval-gate.result == 'success' || needs.approval-gate.result == 'skipped') |
| 29 | && github.repository_owner == 'Effect-Ts' |
| 30 | runs-on: namespace-profile-linux-small |
| 31 | timeout-minutes: 10 |
| 32 | steps: |
| 33 | - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 |
| 34 | - name: Install dependencies |
| 35 | uses: ./.github/actions/setup |
| 36 | - name: Set strip internals config |
| 37 | run: | |
| 38 | sed -i 's/"stripInternal": false/"stripInternal": true/' tsconfig.base.json |
| 39 | - name: Run codemods |
| 40 | run: pnpm codemod |
| 41 | - name: Build package |
| 42 | env: |
| 43 | # Leave memory for the runner and package builds on the 8 GB runner. |
| 44 | # The native TypeScript compiler uses Go's soft memory limit. |
| 45 | GOMEMLIMIT: 4GiB |
| 46 | run: pnpm build |
| 47 | - name: Create snapshot |
| 48 | id: snapshot |
| 49 | run: pnpm exec pkg-pr-new publish --pnpm --comment=off ./packages/* ./packages/atom/* ./packages/ai/* ./packages/platform/* ./packages/sql/* ./packages/tools/* |