Skip to content

Commit c24bdb3

Browse files
committed
chore: add pkg-pr-new and release workflows
1 parent 333244d commit c24bdb3

File tree

4 files changed

+83
-0
lines changed

4 files changed

+83
-0
lines changed

.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### Description
2+
3+
<!-- Please insert your description here and provide info about the "what" this PR is solving. -->
4+
5+
### Linked Issues
6+
7+
<!-- e.g. fixes #123 -->
8+
9+
### Additional Context
10+
11+
<!-- Is there anything you would like the reviewers to focus on? -->
12+
13+
---
14+
15+
> [!TIP]
16+
> The author of this PR can publish a _preview release_ by commenting `/publish` below.

.github/workflows/cr-comment.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Add continuous release label
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
label:
12+
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') }}
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- run: gh issue edit ${{ github.event.issue.number }} --add-label cr-tracked --repo ${{ github.repository }}
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.CR_PAT }}

.github/workflows/cr.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CR
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, labeled, ready_for_review]
7+
8+
permissions: {}
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.number }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
release:
16+
if: ${{ !github.event.pull_request.draft && contains(github.event.pull_request.labels.*.name, 'cr-tracked') }}
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: pnpm/action-setup@v4.0.0
22+
- run: pnpm install
23+
- run: pnpm prepack
24+
- run: pnpx pkg-pr-new publish --compact --no-template --pnpm

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
23+
- run: npx changelogithub
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)