Skip to content

Commit b6814c2

Browse files
committed
Improve release workflow safety: update README only after JitPack success
- Move README version update to happen after JitPack confirms build success - Prevents README showing versions that don't exist on JitPack - If JitPack fails, README keeps previous working version - README update is now a separate commit after release tag - Ensures users never see broken dependency instructions
1 parent 34b0efd commit b6814c2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,14 @@ jobs:
8282
sed -i "s/<dynamodb-toolkit.version>.*<\/dynamodb-toolkit.version>/<dynamodb-toolkit.version>$NEW_VERSION<\/dynamodb-toolkit.version>/" pom.xml
8383
sed -i "s/<dynamodb-toolkit.version>.*<\/dynamodb-toolkit.version>/<dynamodb-toolkit.version>$NEW_VERSION<\/dynamodb-toolkit.version>/" integration-tests/pom.xml
8484
85-
# Update version in README.md
86-
sed -i "s/<version>v[^<]*<\/version>/<version>v$NEW_VERSION<\/version>/" README.md
87-
8885
- name: Build and verify
8986
run: |
9087
mvn clean install
9188
cd integration-tests && mvn clean compile
9289
9390
- name: Commit and tag release
9491
run: |
95-
git add pom.xml integration-tests/pom.xml README.md
92+
git add pom.xml integration-tests/pom.xml
9693
git commit -m "Release version $NEW_VERSION"
9794
git tag -a "v$NEW_VERSION" -m "Release version $NEW_VERSION"
9895
@@ -186,6 +183,15 @@ jobs:
186183
echo "✅ JitPack build completed successfully!"
187184
echo "📦 Artifact available at: https://jitpack.io/#wassertim/dynamodb-toolkit/v$NEW_VERSION"
188185
echo "🔗 Build log: https://jitpack.io/com/github/wassertim/dynamodb-toolkit/v$NEW_VERSION/build.log"
186+
187+
# Now that JitPack succeeded, update README with new version
188+
echo "📝 Updating README.md with confirmed working version..."
189+
sed -i "s/<version>v[^<]*<\/version>/<version>v$NEW_VERSION<\/version>/" README.md
190+
git add README.md
191+
git commit -m "Update README.md to version $NEW_VERSION after JitPack success"
192+
git push origin main
193+
194+
echo "🎉 Release $NEW_VERSION completed successfully!"
189195
exit 0
190196
;;
191197
"error"|"Error")

0 commit comments

Comments
 (0)