diff --git a/.github/workflows/pkg-pr.yml b/.github/workflows/pkg-pr.yml new file mode 100644 index 000000000..a9ee67d57 --- /dev/null +++ b/.github/workflows/pkg-pr.yml @@ -0,0 +1,45 @@ +name: 'pkg-pr' +on: + push: + branches: + - 'refactor/node' + tags: + - '!**' + pull_request: + branches: + - 'refactor/node' + pull_request_review: + types: [submitted] + + +jobs: + continuous-release: + if: github.repository == 'farm-fe/farm' && github.event.review.state == 'APPROVED' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache rust artifacts + uses: oxidecomputer/actions-rs_toolchain@oxide/master + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + cache: 'pnpm' + + - name: Install deps + run: pnpm install + + - name: Build + run: pnpm run pkg:pr + + - name: Release + run: pnpx pkg-pr-new publish --compact --pnpm './packages/cli' './packages/core' \ No newline at end of file diff --git a/package.json b/package.json index 66c35bed6..0eb8b134c 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "bump": "node scripts/bump.mjs", "bump:create-farm": "node scripts/bump-create-farm-version.mjs", "test:rs:update": "cross-env FARM_UPDATE_SNAPSHOTS=1 cargo test -p farmfe_compiler", + "pkg:pr": "node scripts/pkg-pr.mjs", "ready": "node scripts/ready.mjs", "test-e2e": "vitest run -c vitest.config.e2e.ts", "prepare": "husky", diff --git a/scripts/pkg-pr.mjs b/scripts/pkg-pr.mjs new file mode 100644 index 000000000..7d35b2bd6 --- /dev/null +++ b/scripts/pkg-pr.mjs @@ -0,0 +1,5 @@ +import { buildCli, buildCoreCjs, runTaskQueue } from './build.mjs'; + +await runTaskQueue(); +await buildCli(); +await buildCoreCjs();