Skip to content

Commit f7edbd3

Browse files
authored
Merge pull request #2459 from contentstack/fix/v2-dev-bugfix
Back Merge v2-dev to v2-dev-bugfix
2 parents efa548f + 2a6288a commit f7edbd3

File tree

13 files changed

+790
-1276
lines changed

13 files changed

+790
-1276
lines changed
Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Release CLI Core (v2 Beta)
22

33
on:
4-
push:
5-
branches: [v2-beta]
4+
workflow_call:
65

76
jobs:
87
build:
@@ -11,7 +10,7 @@ jobs:
1110
- uses: actions/checkout@v4
1211
- uses: pnpm/action-setup@v4
1312
with:
14-
version: 7
13+
version: 10.28.0
1514
- uses: actions/setup-node@v4
1615
with:
1716
node-version: '22.x'
@@ -20,10 +19,16 @@ jobs:
2019
run: corepack enable
2120

2221
- name: Install pnpm
23-
run: corepack prepare pnpm@7 --activate
22+
run: corepack prepare pnpm@10.28.0 --activate
23+
24+
- name: Clean the repository
25+
run: pnpm run clean:all
2426

2527
- name: Install root dependencies
26-
run: pnpm install
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Build all packages
31+
run: pnpm -r --sort run build
2732

2833
- name: Reading Configuration
2934
id: release_config
@@ -32,39 +37,26 @@ jobs:
3237
filename: .github/config/release.json
3338
prefix: release
3439

35-
# Core CLI
36-
- name: Installing dependencies of core
37-
id: core-installation
38-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_core == 'true'}}
39-
working-directory: ./packages/contentstack
40-
run: npm install
41-
- name: Compiling core
42-
if: ${{ steps.core-installation.conclusion == 'success' }}
43-
working-directory: ./packages/contentstack
44-
run: npm run prepack
4540
- name: Publishing core (Beta)
4641
id: publish-core
4742
uses: JS-DevTools/npm-publish@v3
48-
if: ${{ steps.core-installation.conclusion == 'success' }}
4943
with:
5044
token: ${{ secrets.NPM_TOKEN }}
5145
package: ./packages/contentstack/package.json
5246
tag: beta
5347

5448
- name: Create Core Beta Release
55-
if: ${{ steps.publish-core.conclusion == 'success' }}
5649
id: create_release
5750
env:
5851
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5952
VERSION: ${{ steps.publish-core.outputs.version }}
6053
run: |
61-
# Look for the last release specifically starting with the 'core@v' prefix
62-
PREVIOUS_BETA=$(gh release list --limit 50 | grep 'core@v' | grep 'beta' | head -1 | cut -f1)
63-
64-
if [ -n "$PREVIOUS_BETA" ]; then
65-
# Compare current core version against previous core version
66-
gh release create "core@v$VERSION" --title "Core Beta $VERSION" --notes-from-tag "$PREVIOUS_BETA" --prerelease
54+
TAG="core@v${VERSION}"
55+
if gh release view "$TAG" &>/dev/null; then
56+
echo "Release $TAG already exists — skipping."
6757
else
68-
# Fallback if this is the first core@v release
69-
gh release create "core@v$VERSION" --title "Core Beta $VERSION" --generate-notes --prerelease
58+
gh release create "$TAG" \
59+
--title "Core Beta $VERSION" \
60+
--generate-notes \
61+
--prerelease
7062
fi
Lines changed: 10 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
name: Release CLI Platform Plugins (v2 Beta)
22

33
on:
4-
push:
5-
branches: [v2-beta]
4+
workflow_call:
65

76
jobs:
87
build:
@@ -11,7 +10,7 @@ jobs:
1110
- uses: actions/checkout@v4
1211
- uses: pnpm/action-setup@v4
1312
with:
14-
version: 7
13+
version: 10.28.0
1514
- uses: actions/setup-node@v4
1615
with:
1716
node-version: '22.x'
@@ -20,10 +19,16 @@ jobs:
2019
run: corepack enable
2120

2221
- name: Install pnpm
23-
run: corepack prepare pnpm@7 --activate
22+
run: corepack prepare pnpm@10.28.0 --activate
23+
24+
- name: Clean the repository
25+
run: pnpm run clean:all
2426

2527
- name: Install root dependencies
26-
run: pnpm install
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Build all plugins
31+
run: pnpm -r --sort run build
2732

2833
- name: Reading Configuration
2934
id: release_config
@@ -33,128 +38,41 @@ jobs:
3338
prefix: release
3439

3540
# Dev Dependencies
36-
- name: Installing dependencies of dev dependencies
37-
id: dev-dependencies-installation
38-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_dev-dependencies == 'true'}}
39-
working-directory: ./packages/contentstack-dev-dependencies
40-
run: npm install
41-
- name: Compiling dev dependencies
42-
if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }}
43-
working-directory: ./packages/contentstack-dev-dependencies
44-
run: npm run prepack
4541
- name: Publishing dev dependencies (Beta)
4642
uses: JS-DevTools/npm-publish@v3
47-
if: ${{ steps.dev-dependencies-installation.conclusion == 'success' }}
4843
with:
4944
token: ${{ secrets.NPM_TOKEN }}
5045
package: ./packages/contentstack-dev-dependencies/package.json
5146
tag: beta
5247

5348
# Utilities
54-
- name: Installing dependencies of utilities
55-
id: utilities-installation
56-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}}
57-
working-directory: ./packages/contentstack-utilities
58-
run: npm install
59-
- name: Compiling utilities
60-
if: ${{ steps.utilities-installation.conclusion == 'success' }}
61-
working-directory: ./packages/contentstack-utilities
62-
run: npm run prepack
6349
- name: Publishing utilities (Beta)
6450
uses: JS-DevTools/npm-publish@v3
65-
if: ${{ steps.utilities-installation.conclusion == 'success' }}
6651
with:
6752
token: ${{ secrets.NPM_TOKEN }}
6853
package: ./packages/contentstack-utilities/package.json
6954
tag: beta
7055

71-
# Variants
72-
- name: Installing dependencies of variants
73-
id: variants-installation
74-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_utilities == 'true'}}
75-
working-directory: ./packages/contentstack-variants
76-
run: npm install
77-
- name: Compiling variants
78-
if: ${{ steps.variants-installation.conclusion == 'success' }}
79-
working-directory: ./packages/contentstack-variants
80-
run: npm run prepack
81-
- name: Publishing variants (Beta)
82-
uses: JS-DevTools/npm-publish@v3
83-
if: ${{ steps.variants-installation.conclusion == 'success' }}
84-
with:
85-
token: ${{ secrets.NPM_TOKEN }}
86-
package: ./packages/contentstack-variants/package.json
87-
access: public
88-
tag: beta
89-
9056
# Command
91-
- name: Installing dependencies of command
92-
id: command-installation
93-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_command == 'true'}}
94-
working-directory: ./packages/contentstack-command
95-
run: npm install
96-
- name: Compiling command
97-
if: ${{ steps.command-installation.conclusion == 'success' }}
98-
working-directory: ./packages/contentstack-command
99-
run: npm run prepack
10057
- name: Publishing command (Beta)
10158
uses: JS-DevTools/npm-publish@v3
102-
if: ${{ steps.command-installation.conclusion == 'success' }}
10359
with:
10460
token: ${{ secrets.NPM_TOKEN }}
10561
package: ./packages/contentstack-command/package.json
10662
tag: beta
10763

10864
# Config
109-
- name: Installing dependencies of config
110-
id: config-installation
111-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_config == 'true'}}
112-
working-directory: ./packages/contentstack-config
113-
run: npm install
114-
- name: Compiling config
115-
if: ${{ steps.config-installation.conclusion == 'success' }}
116-
working-directory: ./packages/contentstack-config
117-
run: npm run prepack
11865
- name: Publishing config (Beta)
11966
uses: JS-DevTools/npm-publish@v3
120-
if: ${{ steps.config-installation.conclusion == 'success' }}
12167
with:
12268
token: ${{ secrets.NPM_TOKEN }}
12369
package: ./packages/contentstack-config/package.json
12470
tag: beta
12571

12672
# Auth
127-
- name: Installing dependencies of auth
128-
id: auth-installation
129-
if: ${{env.release_releaseAll == 'true' || env.release_plugins_auth == 'true'}}
130-
working-directory: ./packages/contentstack-auth
131-
run: npm install
132-
- name: Compiling auth
133-
if: ${{ steps.auth-installation.conclusion == 'success' }}
134-
working-directory: ./packages/contentstack-auth
135-
run: npm run prepack
13673
- name: Publishing auth (Beta)
13774
uses: JS-DevTools/npm-publish@v3
138-
if: ${{ steps.auth-installation.conclusion == 'success' }}
13975
with:
14076
token: ${{ secrets.NPM_TOKEN }}
14177
package: ./packages/contentstack-auth/package.json
14278
tag: beta
143-
144-
- name: Create Platform Plugins Beta Release
145-
# Adjust the ID below to match your actual publishing step ID for plugins
146-
if: ${{ steps.publish-plugins.conclusion == 'success' }}
147-
id: create_release_plugins
148-
env:
149-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150-
# Extract version from the output of your plugin publish step
151-
VERSION: ${{ steps.publish-plugins.outputs.version }}
152-
run: |
153-
# Look for the last release specifically starting with 'plugins@v'
154-
PREVIOUS_BETA=$(gh release list --limit 50 | grep 'platform-plugins@v' | grep 'beta' | head -1 | cut -f1)
155-
156-
if [ -n "$PREVIOUS_BETA" ]; then
157-
gh release create "platform-plugins@v$VERSION" --title "Platform Plugins Beta $VERSION" --notes-from-tag "$PREVIOUS_BETA" --prerelease
158-
else
159-
gh release create "platform-plugins@v$VERSION" --title "Platform Plugins Beta $VERSION" --generate-notes --prerelease
160-
fi

0 commit comments

Comments
 (0)