Skip to content

Commit 0de06e5

Browse files
authored
ci: simplify v5 alpha script (#2364)
1 parent 4bb7efc commit 0de06e5

File tree

1 file changed

+5
-42
lines changed

1 file changed

+5
-42
lines changed

.github/workflows/publish-v5-alpha.yml

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,6 @@ jobs:
7474
- name: Build V5 Packages
7575
run: yarn build:libs
7676

77-
# Swap to v5 lerna config temporarily
78-
- name: Setup V5 Lerna Config
79-
run: |
80-
if [ ! -f lerna-v5.json ]; then
81-
echo "ERROR: lerna-v5.json not found. This file is required for v5 publishing."
82-
exit 1
83-
fi
84-
mv lerna.json lerna-v4.json.tmp
85-
mv lerna-v5.json lerna.json
86-
8777
# Dry run to see what would be published
8878
- name: Dry Run - Show what would be published
8979
if: ${{ inputs.publish == false }}
@@ -101,13 +91,6 @@ jobs:
10191
echo ""
10292
echo "=== To actually publish, re-run with 'publish' checkbox checked ==="
10393
104-
# Restore lerna config after dry run
105-
- name: Dry Run - Restore Lerna Config
106-
if: ${{ inputs.publish == false }}
107-
run: |
108-
mv lerna.json lerna-v5.json
109-
mv lerna-v4.json.tmp lerna.json
110-
11194
# Auto-increment prerelease version
11295
- name: Increment Version
11396
if: ${{ inputs.publish }}
@@ -138,8 +121,9 @@ jobs:
138121
- name: Commit Version Changes
139122
if: ${{ inputs.publish }}
140123
run: |
124+
NEW_VERSION=$(node -p "require('./lerna.json').version")
141125
git add -A
142-
git commit --no-verify -m "chore: bump versions for alpha publish [skip ci]"
126+
git commit --no-verify -m "chore(v5): publish alpha version $NEW_VERSION [skip ci]"
143127
144128
# Publish packages from the updated package.json versions
145129
- name: Publish V5 Alpha to NPM
@@ -166,35 +150,14 @@ jobs:
166150
echo "lerna_published=true" >> $GITHUB_ENV
167151
fi
168152
169-
# Restore lerna configs to their original names for committing
170-
- name: Restore Lerna Config Names
171-
if: ${{ inputs.publish }}
172-
run: |
173-
mv lerna.json lerna-v5.json
174-
mv lerna-v4.json.tmp lerna.json
175-
176-
# Format lerna-v5.json to satisfy Prettier checks
177-
- name: Format Lerna Config
178-
if: ${{ inputs.publish }}
179-
run: npx prettier --write lerna-v5.json
180-
181-
# Amend commit with restored lerna configs and create tag
182-
- name: Amend Commit and Tag Changes
153+
# Tag the version commit
154+
- name: Tag Changes
183155
if: ${{ inputs.publish && env.lerna_published == 'true' }}
184156
shell: bash
185157
run: |
186-
# Get the new version from lerna-v5.json
187-
NEW_VERSION=$(node -p "require('./lerna-v5.json').version")
158+
NEW_VERSION=$(node -p "require('./lerna.json').version")
188159
echo "Published version: $NEW_VERSION"
189160
190-
# Stage the restored lerna configs and removal of tmp file
191-
git add lerna.json lerna-v5.json
192-
git add -u # This stages the deletion of lerna-v4.json.tmp
193-
194-
# Amend the previous commit to include the restored lerna configs
195-
git commit --amend --no-verify -m "chore(v5): publish alpha version $NEW_VERSION [skip ci]"
196-
197-
# Create tag for the release
198161
TAG_NAME="v$NEW_VERSION"
199162
echo "Creating tag: $TAG_NAME"
200163
git tag -a "$TAG_NAME" -m "v$NEW_VERSION"

0 commit comments

Comments
 (0)