diff --git a/.github/workflows/pkg-pr-new.yml b/.github/workflows/pkg-pr-new.yml new file mode 100644 index 0000000..950bdb4 --- /dev/null +++ b/.github/workflows/pkg-pr-new.yml @@ -0,0 +1,41 @@ +name: pkg.pr.new + +on: + pull_request: + branches: [main] + +permissions: + contents: read + pull-requests: write + +concurrency: + group: pkg-pr-new-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + publish: + name: Publish preview package + runs-on: ubuntu-latest + + steps: + - name: Checkout Repo + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + with: + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version-file: '.nvmrc' + + - name: Setup PNPM + uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build package + run: pnpm build + + - name: Publish preview package + run: pnpm exec pkg-pr-new publish --commentWithSha --packageManager=pnpm diff --git a/package.json b/package.json index 5e504c8..0ff1577 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "@types/react-dom": "^19.2.3", "es-module-lexer": "1.7.0", "kill-port": "^2.0.1", + "pkg-pr-new": "^0.0.75", "playwright": "^1.58.0", "prettier": "3.8.1", "react": "^19.2.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 596ac75..633631e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -123,6 +123,9 @@ importers: kill-port: specifier: ^2.0.1 version: 2.0.1 + pkg-pr-new: + specifier: ^0.0.75 + version: 0.0.75 playwright: specifier: ^1.58.0 version: 1.58.0 @@ -7710,6 +7713,10 @@ packages: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} + pkg-pr-new@0.0.75: + resolution: {integrity: sha512-u9mdErTewKSMsr+ceCt8VcNuNP0ro5AXiPXhUVApuEyqr2Zlvt+DdCFBcm+yGWN8mhOdZJ27meIDbnoZgfzpOw==} + hasBin: true + pkg-types@2.3.0: resolution: {integrity: sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==} @@ -15958,6 +15965,8 @@ snapshots: pify@4.0.1: {} + pkg-pr-new@0.0.75: {} + pkg-types@2.3.0: dependencies: confbox: 0.2.2