-
Notifications
You must be signed in to change notification settings - Fork 12
170 lines (139 loc) · 5.02 KB
/
prepare-release.yml
File metadata and controls
170 lines (139 loc) · 5.02 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Prepare Release
on:
push:
branches:
- main
concurrency:
group: prepare-release
cancel-in-progress: true
permissions:
contents: read
id-token: write
jobs:
prepare:
outputs:
version: ${{ steps.version.outputs.version }}
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0
- name: Setup JFrog npm
uses: ./.github/actions/setup-jfrog-npm
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check for releasable commits
id: version
run: |
VERSION=$(pnpm exec release-it --release-version --ci) || true
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Next version: $VERSION"
else
echo "No releasable commits — skipping release preparation"
echo "version=" >> "$GITHUB_OUTPUT"
fi
- name: Generate changelog
if: steps.version.outputs.version != ''
run: |
pnpm exec release-it ${{ steps.version.outputs.version }} --ci
- name: Sync versions
if: steps.version.outputs.version != ''
run: pnpm exec tsx tools/sync-versions.ts "${{ steps.version.outputs.version }}"
- name: Build
if: steps.version.outputs.version != ''
run: pnpm build && pnpm --filter=docs build
- name: Dist
if: steps.version.outputs.version != ''
run: |
pnpm --filter=@databricks/appkit dist
pnpm --filter=@databricks/appkit-ui dist
- name: SBOM
if: steps.version.outputs.version != ''
run: pnpm release:sbom
- name: Build NOTICE
if: steps.version.outputs.version != ''
run: pnpm build:notice
- name: Pack
if: steps.version.outputs.version != ''
run: |
npm pack packages/appkit/tmp
npm pack packages/appkit-ui/tmp
- name: Generate SHA256
if: steps.version.outputs.version != ''
run: sha256sum *.tgz > SHA256SUMS
- name: Write version file
if: steps.version.outputs.version != ''
run: echo "${{ steps.version.outputs.version }}" > VERSION
- name: Upload release metadata
if: steps.version.outputs.version != ''
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: appkit-release-meta-${{ github.run_number }}
retention-days: 7
path: VERSION
- name: Upload release artifacts
if: steps.version.outputs.version != ''
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: appkit-release-${{ github.run_number }}
retention-days: 7
path: |
*.tgz
changelog-diff.md
VERSION
SHA256SUMS
NOTICE.md
template-artifact:
needs: [prepare]
if: needs.prepare.outputs.version != ''
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup JFrog npm
uses: ./.github/actions/setup-jfrog-npm
- name: Setup pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 24
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Download release artifacts
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: appkit-release-${{ github.run_number }}
path: release-artifacts
- name: Prepare template artifact
run: >
pnpm exec tsx tools/prepare-template-artifact.ts
--version "${{ needs.prepare.outputs.version }}"
--tarball-dir release-artifacts
--output-dir template-artifact
- name: Install template dependencies
working-directory: template-artifact
run: npm install
- name: Create zip artifact
working-directory: template-artifact
run: zip -r ../template.zip . -x 'node_modules/*'
- name: Upload template artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: appkit-template-${{ github.run_number }}
retention-days: 7
path: template.zip