Skip to content

Commit fe5cdec

Browse files
rqbazanclaude
andauthored
ci: unify preview and release into a single workflow (#7)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 92458d5 commit fe5cdec

2 files changed

Lines changed: 28 additions & 38 deletions

File tree

‎.github/workflows/preview.yml‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎.github/workflows/release.yml‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@ on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
types: [opened, synchronize, reopened, labeled]
9+
branches:
10+
- main
711

812
concurrency:
913
group: ${{ github.workflow }}-${{ github.ref }}
1014
cancel-in-progress: true
1115

1216
jobs:
1317
release:
18+
if: ${{ github.event_name == 'push' }}
1419
runs-on: ubuntu-latest
1520
permissions:
1621
id-token: write
@@ -54,3 +59,26 @@ jobs:
5459
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5560
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5661
LEFTHOOK: 0
62+
63+
preview:
64+
if: ${{ github.event_name == 'pull_request' && (startsWith(github.head_ref, 'feat') || startsWith(github.head_ref, 'fix') || contains(github.event.pull_request.labels.*.name, 'preview')) }}
65+
runs-on: ubuntu-latest
66+
permissions:
67+
id-token: write
68+
contents: read
69+
steps:
70+
- name: ⬇️ Checkout repo
71+
uses: actions/checkout@v4
72+
73+
- name: 🟢 Setup Node.js
74+
uses: actions/setup-node@v6
75+
with:
76+
node-version-file: .node-version
77+
78+
- name: ⌛ Setup CI
79+
uses: variableland/gh-actions/actions/setup-pnpm@main
80+
81+
- name: 🚀 Preview release
82+
uses: variableland/gh-actions/actions/preview-release@main
83+
with:
84+
npm_token: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)