mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
refractor: separate preview and release workflows
This commit is contained in:
30
.github/workflows/preview.yaml
vendored
Normal file
30
.github/workflows/preview.yaml
vendored
Normal 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
|
||||
@@ -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 }}
|
||||
Reference in New Issue
Block a user