From 7ed84bd624cf6881cce888913c1e6b611e9dbecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Sat, 17 Aug 2024 19:56:24 +0200 Subject: [PATCH] chore: add `pkg.pr.new` (#741) * chore: add `pkg.pr.new` * chore: change build script --- .github/pull_request_template.md | 28 ++++++++++++++++++++++++++++ .github/workflows/cr-comment.yml | 18 ++++++++++++++++++ .github/workflows/cr.yml | 27 +++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) 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 00000000..f701ba1c --- /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 00000000..203b7e11 --- /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 00000000..0e60b2dd --- /dev/null +++ b/.github/workflows/cr.yml @@ -0,0 +1,27 @@ +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 + - run: pnpm install + - run: pnpm build + - run: pnpx pkg-pr-new publish --compact --no-template --pnpm