Skip to content

Commit 544bb54

Browse files
committed
updated release workflow
1 parent 0446389 commit 544bb54

3 files changed

Lines changed: 86 additions & 300 deletions

File tree

Lines changed: 59 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Release CLI Plugins
1+
name: Release CLI Plugins (Beta)
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [v2-beta]
66

77
jobs:
88
build:
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v4
1212
- uses: pnpm/action-setup@v4
1313
with:
14-
version: 7
14+
version: 10.28.0
1515
- uses: actions/setup-node@v4
1616
with:
1717
node-version: '22.x'
@@ -20,7 +20,7 @@ jobs:
2020
run: corepack enable
2121

2222
- name: Install pnpm
23-
run: corepack prepare pnpm@7 --activate
23+
run: corepack prepare pnpm@10.28.0 --activate
2424

2525
- name: Install root dependencies
2626
run: pnpm install
@@ -31,36 +31,8 @@ jobs:
3131
with:
3232
filename: .github/config/release.json
3333
prefix: release
34-
- name: Installing dependencies of dev dependencies
35-
id: dev-dependencies-installation
36-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_dev-dependencies == 'true'}}
37-
working-directory: ./packages/contentstack-dev-dependencies
38-
run: npm install
39-
- name: Compiling dev dependencies
40-
if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }}
41-
working-directory: ./packages/contentstack-dev-dependencies
42-
run: npm run prepack
43-
- name: Publishing dev dependencies
44-
uses: JS-DevTools/npm-publish@v3
45-
if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }}
46-
with:
47-
token: ${{ secrets.NPM_TOKEN }}
48-
package: ./packages/contentstack-dev-dependencies/package.json
49-
- name: Installing dependencies of utilities
50-
id: utilities-installation
51-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}}
52-
working-directory: ./packages/contentstack-utilities
53-
run: npm install
54-
- name: Compiling utilities
55-
if: ${{ steps.utilities-installation.conclusion == 'success' }}
56-
working-directory: ./packages/contentstack-utilities
57-
run: npm run prepack
58-
- name: Publishing utilities
59-
uses: JS-DevTools/npm-publish@v3
60-
if: ${{ steps.utilities-installation.conclusion == 'success' }}
61-
with:
62-
token: ${{ secrets.NPM_TOKEN }}
63-
package: ./packages/contentstack-utilities/package.json
34+
35+
# Variants
6436
- name: Installing dependencies of variants
6537
id: variants-installation
6638
if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}}
@@ -70,58 +42,16 @@ jobs:
7042
if: ${{ steps.variants-installation.conclusion == 'success' }}
7143
working-directory: ./packages/contentstack-variants
7244
run: npm run prepack
73-
- name: Publishing variants
45+
- name: Publishing variants (Beta)
7446
uses: JS-DevTools/npm-publish@v3
7547
if: ${{ steps.variants-installation.conclusion == 'success' }}
7648
with:
7749
token: ${{ secrets.NPM_TOKEN }}
7850
package: ./packages/contentstack-variants/package.json
7951
access: public
80-
- name: Installing dependencies of command
81-
id: command-installation
82-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_command == 'true'}}
83-
working-directory: ./packages/contentstack-command
84-
run: npm install
85-
- name: Compiling command
86-
if: ${{ steps.command-installation.conclusion == 'success' }}
87-
working-directory: ./packages/contentstack-command
88-
run: npm run prepack
89-
- name: Publishing command
90-
uses: JS-DevTools/npm-publish@v3
91-
if: ${{ steps.command-installation.conclusion == 'success' }}
92-
with:
93-
token: ${{ secrets.NPM_TOKEN }}
94-
package: ./packages/contentstack-command/package.json
95-
- name: Installing dependencies of config
96-
id: config-installation
97-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_config == 'true'}}
98-
working-directory: ./packages/contentstack-config
99-
run: npm install
100-
- name: Compiling config
101-
if: ${{ steps.config-installation.conclusion == 'success' }}
102-
working-directory: ./packages/contentstack-config
103-
run: npm run prepack
104-
- name: Publishing config
105-
uses: JS-DevTools/npm-publish@v3
106-
if: ${{ steps.config-installation.conclusion == 'success' }}
107-
with:
108-
token: ${{ secrets.NPM_TOKEN }}
109-
package: ./packages/contentstack-config/package.json
110-
- name: Installing dependencies of auth
111-
id: auth-installation
112-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_auth == 'true'}}
113-
working-directory: ./packages/contentstack-auth
114-
run: npm install
115-
- name: Compiling auth
116-
if: ${{ steps.auth-installation.conclusion == 'success' }}
117-
working-directory: ./packages/contentstack-auth
118-
run: npm run prepack
119-
- name: Publishing auth
120-
uses: JS-DevTools/npm-publish@v3
121-
if: ${{ steps.auth-installation.conclusion == 'success' }}
122-
with:
123-
token: ${{ secrets.NPM_TOKEN }}
124-
package: ./packages/contentstack-auth/package.json
52+
tag: beta
53+
54+
# Export
12555
- name: Installing dependencies of export
12656
id: export-installation
12757
if: ${{ env.release_releaseAll == 'true' || env.release_plugins_export == 'true'}}
@@ -131,12 +61,15 @@ jobs:
13161
if: ${{ steps.export-installation.conclusion == 'success' }}
13262
working-directory: ./packages/contentstack-export
13363
run: npm run prepack
134-
- name: Publishing export
64+
- name: Publishing export (Beta)
13565
uses: JS-DevTools/npm-publish@v3
13666
if: ${{ steps.export-installation.conclusion == 'success' }}
13767
with:
13868
token: ${{ secrets.NPM_TOKEN }}
13969
package: ./packages/contentstack-export/package.json
70+
tag: beta
71+
72+
# Audit
14073
- name: Installing dependencies of audit
14174
id: audit-installation
14275
if: ${{env.release_releaseAll == 'true' || env.release_plugins_audit == 'true'}}
@@ -146,13 +79,16 @@ jobs:
14679
if: ${{ steps.audit-installation.conclusion == 'success' }}
14780
working-directory: ./packages/contentstack-audit
14881
run: npm run prepack
149-
- name: Publishing audit
82+
- name: Publishing audit (Beta)
15083
uses: JS-DevTools/npm-publish@v3
15184
if: ${{ steps.audit-installation.conclusion == 'success' }}
15285
with:
15386
token: ${{ secrets.NPM_TOKEN }}
15487
package: ./packages/contentstack-audit/package.json
15588
access: public
89+
tag: beta
90+
91+
# Import
15692
- name: Installing dependencies of import
15793
id: import-installation
15894
if: ${{env.release_releaseAll == 'true' || env.release_plugins_import == 'true'}}
@@ -162,27 +98,29 @@ jobs:
16298
if: ${{ steps.import-installation.conclusion == 'success' }}
16399
working-directory: ./packages/contentstack-import
164100
run: npm run prepack
165-
- name: Publishing import
101+
- name: Publishing import (Beta)
166102
uses: JS-DevTools/npm-publish@v3
167103
if: ${{ steps.import-installation.conclusion == 'success' }}
168104
with:
169105
token: ${{ secrets.NPM_TOKEN }}
170106
package: ./packages/contentstack-import/package.json
107+
tag: beta
108+
109+
# Clone
171110
- name: Installing dependencies of clone
172111
id: clone-installation
173112
if: ${{env.release_releaseAll == 'true' || env.release_plugins_clone == 'true'}}
174113
working-directory: ./packages/contentstack-clone
175114
run: npm install
176-
- name: Compiling Clone
177-
if: ${{ steps.clone-installation.conclusion == 'success' }}
178-
working-directory: ./packages/contentstack-clone
179-
run: npm run prepack
180-
- name: Publishing clone
115+
- name: Publishing clone (Beta)
181116
uses: JS-DevTools/npm-publish@v3
182117
if: ${{ steps.clone-installation.conclusion == 'success' }}
183118
with:
184119
token: ${{ secrets.NPM_TOKEN }}
185120
package: ./packages/contentstack-clone/package.json
121+
tag: beta
122+
123+
# Import Setup
186124
- name: Installing dependencies of import-setup
187125
id: import-setup-installation
188126
if: ${{env.release_releaseAll == 'true' || env.release_plugins_import_setup == 'true'}}
@@ -192,54 +130,44 @@ jobs:
192130
if: ${{ steps.import-setup-installation.conclusion == 'success' }}
193131
working-directory: ./packages/contentstack-import-setup
194132
run: npm run prepack
195-
- name: Publishing import-setup
133+
- name: Publishing import-setup (Beta)
196134
uses: JS-DevTools/npm-publish@v3
197135
if: ${{ steps.import-setup-installation.conclusion == 'success' }}
198136
with:
199137
token: ${{ secrets.NPM_TOKEN }}
200138
package: ./packages/contentstack-import-setup/package.json
201139
access: public
140+
tag: beta
141+
142+
# Export to CSV
202143
- name: Installing dependencies of export to csv
203144
id: export-to-csv-installation
204145
if: ${{env.release_releaseAll == 'true' || env.release_plugins_export-to-csv == 'true'}}
205146
working-directory: ./packages/contentstack-export-to-csv
206147
run: npm install
207-
- name: Compiling export to csv
208-
if: ${{ steps.export-to-csv-installation.conclusion == 'success' }}
209-
working-directory: ./packages/contentstack-export-to-csv
210-
run: npm run prepack
211-
- name: Publishing export to csv
148+
- name: Publishing export to csv (Beta)
212149
uses: JS-DevTools/npm-publish@v3
213150
if: ${{ steps.export-to-csv-installation.conclusion == 'success' }}
214151
with:
215152
token: ${{ secrets.NPM_TOKEN }}
216153
package: ./packages/contentstack-export-to-csv/package.json
217-
- name: Installing dependencies of migrate rte
218-
id: migrate-rte-installation
219-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_migrate-rte == 'true'}}
220-
working-directory: ./packages/contentstack-migrate-rte
221-
run: npm install
222-
- name: Publishing migrate rte
223-
uses: JS-DevTools/npm-publish@v3
224-
if: ${{ steps.migrate-rte-installation.conclusion == 'success' }}
225-
with:
226-
token: ${{ secrets.NPM_TOKEN }}
227-
package: ./packages/contentstack-migrate-rte/package.json
154+
tag: beta
155+
156+
# Migration
228157
- name: Installing dependencies of migration
229158
id: migration-installation
230159
if: ${{env.release_releaseAll == 'true' || env.release_plugins_migration == 'true'}}
231160
working-directory: ./packages/contentstack-migration
232161
run: npm install
233-
- name: Compiling Migration
234-
if: ${{ steps.migration-installation.conclusion == 'success' }}
235-
working-directory: ./packages/contentstack-migration
236-
run: npm run prepack
237-
- name: Publishing migration
162+
- name: Publishing migration (Beta)
238163
uses: JS-DevTools/npm-publish@v3
239164
if: ${{ steps.migration-installation.conclusion == 'success' }}
240165
with:
241166
token: ${{ secrets.NPM_TOKEN }}
242167
package: ./packages/contentstack-migration/package.json
168+
tag: beta
169+
170+
# Seed
243171
- name: Installing dependencies of seed
244172
id: seed-installation
245173
if: ${{env.release_releaseAll == 'true' || env.release_plugins_seed == 'true'}}
@@ -249,12 +177,15 @@ jobs:
249177
if: ${{ steps.seed-installation.conclusion == 'success' }}
250178
working-directory: ./packages/contentstack-seed
251179
run: npm run prepack
252-
- name: Publishing seed
180+
- name: Publishing seed (Beta)
253181
uses: JS-DevTools/npm-publish@v3
254182
if: ${{ steps.seed-installation.conclusion == 'success' }}
255183
with:
256184
token: ${{ secrets.NPM_TOKEN }}
257185
package: ./packages/contentstack-seed/package.json
186+
tag: beta
187+
188+
# Bootstrap
258189
- name: Installing dependencies of bootstrap
259190
id: bootstrap-installation
260191
if: ${{env.release_releaseAll == 'true' || env.release_plugins_bootstrap == 'true'}}
@@ -264,23 +195,15 @@ jobs:
264195
if: ${{ steps.bootstrap-installation.conclusion == 'success' }}
265196
working-directory: ./packages/contentstack-bootstrap
266197
run: npm run prepack
267-
- name: Publishing bootstrap
198+
- name: Publishing bootstrap (Beta)
268199
uses: JS-DevTools/npm-publish@v3
269200
if: ${{ steps.bootstrap-installation.conclusion == 'success' }}
270201
with:
271202
token: ${{ secrets.NPM_TOKEN }}
272203
package: ./packages/contentstack-bootstrap/package.json
273-
- name: Installing dependencies of bulk publish
274-
id: bulk-publish-installation
275-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_bulk-publish == 'true'}}
276-
working-directory: ./packages/contentstack-bulk-publish
277-
run: npm install
278-
- name: Publishing bulk publish
279-
uses: JS-DevTools/npm-publish@v3
280-
if: ${{ steps.bulk-publish-installation.conclusion == 'success' }}
281-
with:
282-
token: ${{ secrets.NPM_TOKEN }}
283-
package: ./packages/contentstack-bulk-publish/package.json
204+
tag: beta
205+
206+
# Branches
284207
- name: Installing dependencies of branches
285208
id: branches-installation
286209
if: ${{env.release_releaseAll == 'true' || env.release_plugins_branches == 'true'}}
@@ -290,43 +213,27 @@ jobs:
290213
if: ${{ steps.branches-installation.conclusion == 'success' }}
291214
working-directory: ./packages/contentstack-branches
292215
run: npm run prepack
293-
- name: Publishing branches
216+
- name: Publishing branches (Beta)
294217
uses: JS-DevTools/npm-publish@v3
295218
if: ${{ steps.branches-installation.conclusion == 'success' }}
296219
with:
297220
token: ${{ secrets.NPM_TOKEN }}
298221
package: ./packages/contentstack-branches/package.json
299222
access: public
300-
- name: Installing dependencies of core
301-
id: core-installation
302-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_core == 'true'}}
303-
working-directory: ./packages/contentstack
304-
run: npm install
305-
- name: Compiling core
306-
if: ${{ steps.core-installation.conclusion == 'success' }}
307-
working-directory: ./packages/contentstack
308-
run: npm run prepack
309-
- name: Publishing core
310-
id: publish-core
311-
uses: JS-DevTools/npm-publish@v3
312-
if: ${{ steps.core-installation.conclusion == 'success' }}
313-
with:
314-
token: ${{ secrets.NPM_TOKEN }}
315-
package: ./packages/contentstack/package.json
316-
- uses: actions/checkout@v4
317-
if: ${{ steps.publish-core.conclusion == 'success' }}
318-
with:
319-
ref: 'prod-qa-pipeline'
320-
- run: echo ${{ steps.publish-core.outputs.version }} > version.md
321-
if: ${{ steps.publish-core.conclusion == 'success' }}
322-
- uses: EndBug/add-and-commit@v9
323-
if: ${{ steps.publish-core.conclusion == 'success' }}
324-
with:
325-
message: 'Released version'
326-
- name: Create Release
223+
tag: beta
224+
225+
- name: Create Beta Release
327226
if: ${{ steps.publish-core.conclusion == 'success' }}
328227
id: create_release
329228
env:
330229
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
331230
VERSION: ${{ steps.publish-core.outputs.version }}
332-
run: gh release create v"$VERSION" --title "Release $VERSION" --generate-notes
231+
run: |
232+
# Get the previous beta release for comparison
233+
PREVIOUS_BETA=$(gh release list --limit 10 | grep 'beta' | head -1 | cut -f1)
234+
235+
if [ -n "$PREVIOUS_BETA" ]; then
236+
gh release create v"$VERSION" --title "Beta Release $VERSION" --notes-from-tag "$PREVIOUS_BETA" --prerelease
237+
else
238+
gh release create v"$VERSION" --title "Beta Release $VERSION" --generate-notes --prerelease
239+
fi

0 commit comments

Comments
 (0)