From 57048a39c24eb61338700bc76c71d70d386b3ff0 Mon Sep 17 00:00:00 2001 From: userquin Date: Sat, 17 Aug 2024 21:00:57 +0200 Subject: [PATCH] chore: add `pkg.pr.new` --- .github/pull_request_template.md | 28 ++++++++++++++++++++++++++++ .github/workflows/cr-comment.yml | 18 ++++++++++++++++++ .github/workflows/cr.yml | 32 ++++++++++++++++++++++++++++++++ package.json | 2 +- 4 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/cr-comment.yml create mode 100644 .github/workflows/cr.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..84798fc --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,28 @@ +### Description + + + + + +### Linked Issues + + + +### Additional Context + + + +--- + +> [!TIP] +> The author of this PR can publish a _preview release_ by commenting `/publish` below. diff --git a/.github/workflows/cr-comment.yml b/.github/workflows/cr-comment.yml new file mode 100644 index 0000000..203b7e1 --- /dev/null +++ b/.github/workflows/cr-comment.yml @@ -0,0 +1,18 @@ +name: Add continuous release label + +on: + issue_comment: + types: [created] + +permissions: + pull-requests: write + +jobs: + label: + if: ${{ github.event.issue.pull_request && (github.event.comment.user.id == github.event.issue.user.id || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR') && startsWith(github.event.comment.body, '/publish') }} + runs-on: ubuntu-latest + + steps: + - run: gh issue edit ${{ github.event.issue.number }} --add-label cr-tracked --repo ${{ github.repository }} + env: + GITHUB_TOKEN: ${{ secrets.CR_PAT }} diff --git a/.github/workflows/cr.yml b/.github/workflows/cr.yml new file mode 100644 index 0000000..d59a63b --- /dev/null +++ b/.github/workflows/cr.yml @@ -0,0 +1,32 @@ +name: CR + +env: + PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1' + +on: + pull_request: + branches: [main] + types: [opened, synchronize, labeled, ready_for_review] + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number }} + cancel-in-progress: true + +jobs: + release: + if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'cr-tracked') }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4.0.0 + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + cache: "pnpm" + - run: pnpm install + - run: pnpm build + - run: pnpx pkg-pr-new publish --compact --no-template --pnpm diff --git a/package.json b/package.json index d14295c..27d7760 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@vite-pwa/sveltekit", "type": "module", "version": "0.6.0", - "packageManager": "pnpm@9.4.0", + "packageManager": "pnpm@9.7.1", "description": "Zero-config PWA for SvelteKit", "author": "antfu ", "license": "MIT",