Skip to content

Commit 5fc1ba1

Browse files
refractor: separate preview and release workflows
1 parent 0271edf commit 5fc1ba1

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

.github/workflows/preview.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Preview
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "apps/cli/**"
7+
- "package.json"
8+
- "bun.lock"
9+
10+
concurrency: ${{ github.workflow }}-${{ github.ref }}
11+
12+
jobs:
13+
preview:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Bun
22+
uses: oven-sh/setup-bun@v2
23+
with:
24+
bun-version: latest
25+
26+
- name: Install Dependencies
27+
run: bun install --frozen-lockfile
28+
29+
- name: Publish Preview Package
30+
run: bunx pkg-pr-new publish './apps/cli' --bin
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
name: Publish
1+
name: Release
22

33
on:
44
push:
55
branches:
66
- main
77
- beta
88
paths:
9-
- 'apps/cli/**'
10-
- '.changeset/**'
11-
- 'package.json'
12-
- 'bun.lock'
13-
pull_request:
9+
- "apps/cli/**"
10+
- ".changeset/**"
11+
- "package.json"
12+
- "bun.lock"
1413

1514
concurrency: ${{ github.workflow }}-${{ github.ref }}
1615

1716
jobs:
18-
publish:
17+
release:
1918
runs-on: ubuntu-latest
2019
steps:
2120
- name: Checkout Code
@@ -31,14 +30,12 @@ jobs:
3130
- name: Install Dependencies
3231
run: bun install --frozen-lockfile
3332

34-
- run: bunx pkg-pr-new publish './apps/cli' --bin
35-
3633
- name: Create Release Pull Request or Publish
3734
id: changesets
3835
uses: changesets/action@v1
3936
with:
4037
publish: bun run publish-packages
4138
env:
42-
MODE: 'prod'
39+
MODE: "prod"
4340
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4441
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)