refractor: separate preview and release workflows

This commit is contained in:
Aman Varshney
2025-06-16 19:29:02 +05:30
parent 0271edf5dc
commit 5fc1ba164e
2 changed files with 37 additions and 10 deletions

30
.github/workflows/preview.yaml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Preview
on:
pull_request:
paths:
- "apps/cli/**"
- "package.json"
- "bun.lock"
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Publish Preview Package
run: bunx pkg-pr-new publish './apps/cli' --bin

View File

@@ -1,4 +1,4 @@
name: Publish
name: Release
on:
push:
@@ -6,16 +6,15 @@ on:
- main
- beta
paths:
- 'apps/cli/**'
- '.changeset/**'
- 'package.json'
- 'bun.lock'
pull_request:
- "apps/cli/**"
- ".changeset/**"
- "package.json"
- "bun.lock"
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
@@ -31,14 +30,12 @@ jobs:
- name: Install Dependencies
run: bun install --frozen-lockfile
- run: bunx pkg-pr-new publish './apps/cli' --bin
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: bun run publish-packages
env:
MODE: 'prod'
MODE: "prod"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}