-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathrelease.yml.disable
More file actions
78 lines (67 loc) · 2.51 KB
/
release.yml.disable
File metadata and controls
78 lines (67 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Release
on:
workflow_dispatch: # manual "Run workflow"
permissions:
contents: write
pull-requests: write
issues: write
jobs:
release:
runs-on: ubuntu-latest
steps:
# 1 ▸ Checkout the branch you chose in the UI (default = main)
- uses: actions/checkout@v4
# 2 ▸ Ensure the latest CI on this branch passed
- name: Check CI status
run: |
CI_STATUS=$(gh run list \
--workflow=ci.yml \
--branch=${{ github.ref_name }} \
--limit=1 \
--json conclusion \
--jq '.[0].conclusion')
if [[ "$CI_STATUS" != "success" ]]; then
echo "❌ CI must pass before releasing. Current status: $CI_STATUS"
exit 1
fi
echo "✅ CI passed. Proceeding with release…"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 3 ▸ Calculate tags / CHANGELOG with release-please
- uses: googleapis/release-please-action@v4
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: .release-please-config.json
# 4 ▸ Only continue if at least one package was released
- uses: actions/setup-node@v4
if: ${{ steps.release.outputs.release_created == 'true' }}
with:
node-version: 18
registry-url: https://registry.npmjs.org
- name: Install dependencies
if: ${{ steps.release.outputs.release_created == 'true' }}
run: |
corepack enable
pnpm install --frozen-lockfile
# 5 ▸ Publish each released workspace package
- name: Publish packages
if: ${{ steps.release.outputs.release_created == 'true' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "ℹ️ Packages flagged for publish:"
echo "• core ➡️ ${{ steps.release.outputs['packages/core--release_version'] }}"
echo "• cli ➡️ ${{ steps.release.outputs['packages/cli--release_version'] }}"
if [[ '${{ steps.release.outputs['packages/core--release_created'] }}' == 'true' ]]; then
echo "📦 Publishing @react-zero-ui/core…"
cd packages/core
npm publish --access public
cd ../..
fi
if [[ '${{ steps.release.outputs['packages/cli--release_created'] }}' == 'true' ]]; then
echo "📦 Publishing create-zero-ui…"
cd packages/cli
npm publish --access public
cd ../..
fi