66# ./dump-version.sh [OPTIONS] [VERSION]
77#
88# Options:
9- # --skip-crates Skip publishing to crates.io (default: publish)
109# --dry-run Show what would be done without making changes
1110# --help Show this help message
1211#
2221# 4. Update CHANGELOG.md ([Unreleased] -> [X.Y.Z] - date)
2322# 5. Create git tag vX.Y.Z
2423# 6. Commit the changes
25- # 7. Publish to crates.io (unless --skip-crates is specified)
2624#
2725# After running this script:
2826# 1. Review the changes: git show HEAD
2927# 2. Push to release: git push origin br_release vX.Y.Z
30- #
31- # Environment variables:
32- # CARGO_REGISTRY_TOKEN - crates.io API token (required for publishing)
28+ # 3. CI workflow will create GitHub Release and publish to crates.io
3329#
3430
3531set -e
@@ -50,17 +46,12 @@ CHANGELOG_FILE="CHANGELOG.md"
5046CARGO_TOML=" Cargo.toml"
5147
5248# Options
53- PUBLISH_CRATES=true
5449DRY_RUN=false
5550INPUT_VERSION=" "
5651
5752# Parse options
5853while [[ $# -gt 0 ]]; do
5954 case $1 in
60- --skip-crates|--no-crates)
61- PUBLISH_CRATES=false
62- shift
63- ;;
6455 --dry-run)
6556 DRY_RUN=true
6657 shift
@@ -69,7 +60,6 @@ while [[ $# -gt 0 ]]; do
6960 echo " Usage: $0 [OPTIONS] [VERSION]"
7061 echo " "
7162 echo " Options:"
72- echo " --skip-crates Skip publishing to crates.io (default: publish)"
7363 echo " --dry-run Show what would be done without making changes"
7464 echo " --help Show this help message"
7565 echo " "
@@ -78,13 +68,16 @@ while [[ $# -gt 0 ]]; do
7868 echo " Format: X.Y.Z or X.Y.Z.E"
7969 echo " "
8070 echo " Examples:"
81- echo " $0 # Release to GitHub and crates.io"
82- echo " $0 0.1.2 # Release specific version"
83- echo " $0 --skip-crates # Release to GitHub only"
71+ echo " $0 # Prepare release with gopher-orch version"
72+ echo " $0 0.1.2 # Prepare release for specific version"
8473 echo " $0 --dry-run # Preview changes without executing"
8574 echo " "
86- echo " Environment variables:"
87- echo " CARGO_REGISTRY_TOKEN crates.io API token (required for publishing)"
75+ echo " After running this script, push to trigger CI:"
76+ echo " git push origin br_release vX.Y.Z"
77+ echo " "
78+ echo " CI workflow will:"
79+ echo " - Create GitHub Release with native binaries"
80+ echo " - Publish to crates.io"
8881 echo " "
8982 exit 0
9083 ;;
@@ -110,13 +103,6 @@ if [ "$DRY_RUN" = true ]; then
110103 echo " "
111104fi
112105
113- if [ " $PUBLISH_CRATES " = true ]; then
114- echo -e " ${CYAN} Publishing to: GitHub + crates.io${NC} "
115- else
116- echo -e " ${YELLOW} Publishing to: GitHub only (--skip-crates)${NC} "
117- fi
118- echo " "
119-
120106# -----------------------------------------------------------------------------
121107# Step 1: Fetch latest gopher-orch version from GitHub releases
122108# -----------------------------------------------------------------------------
@@ -424,35 +410,6 @@ else
424410 echo -e " ${YELLOW} [DRY RUN] Would create tag $TAG_VERSION ${NC} "
425411fi
426412
427- # -----------------------------------------------------------------------------
428- # Step 8: Publish to crates.io
429- # -----------------------------------------------------------------------------
430- echo " "
431- if [ " $PUBLISH_CRATES " = true ]; then
432- echo -e " ${YELLOW} Step 8: Publishing to crates.io...${NC} "
433-
434- if [ " $DRY_RUN " = true ]; then
435- echo -e " ${YELLOW} [DRY RUN] Would run: cargo publish${NC} "
436- echo -e " ${CYAN} Verifying package...${NC} "
437- cargo publish --dry-run 2>&1 | head -20 || true
438- else
439- echo -e " ${CYAN} Running cargo publish...${NC} "
440-
441- # Publish
442- if cargo publish; then
443- echo -e " ${GREEN} Successfully published to crates.io${NC} "
444- else
445- echo -e " ${RED} Error: Failed to publish to crates.io${NC} "
446- echo " The git commit and tag were created. You can manually publish later with:"
447- echo " cargo publish"
448- exit 1
449- fi
450- fi
451- else
452- echo -e " ${YELLOW} Step 8: Skipping crates.io publish (--skip-crates)${NC} "
453- fi
454-
455- echo " "
456413echo -e " ${GREEN} ========================================${NC} "
457414echo -e " ${GREEN} Release preparation complete!${NC} "
458415echo -e " ${GREEN} ========================================${NC} "
@@ -463,30 +420,20 @@ if [ "$CARGO_VERSION" != "$TARGET_VERSION" ]; then
463420fi
464421echo -e " Tag: ${CYAN} $TAG_VERSION ${NC} "
465422echo -e " gopher-orch: ${CYAN} $GOPHER_ORCH_VERSION ${NC} "
466- if [ " $PUBLISH_CRATES " = true ]; then
467- echo -e " crates.io: ${GREEN} Published${NC} "
468- else
469- echo -e " crates.io: ${YELLOW} Skipped${NC} "
470- fi
471423echo " "
472424echo -e " ${YELLOW} Next steps:${NC} "
473425echo " 1. Review the commit: git show HEAD"
474426echo " 2. Push to release: git push origin br_release $TAG_VERSION "
475427echo " "
476- echo -e " ${CYAN} After pushing:${NC} "
477- echo " - CI workflow will create GitHub Release"
478- echo " - Native libraries will be attached to release"
479- if [ " $PUBLISH_CRATES " = false ]; then
480- echo " - Publish to crates.io manually: cargo publish"
481- fi
428+ echo -e " ${CYAN} After pushing, CI will:${NC} "
429+ echo " - Create GitHub Release with native binaries"
430+ echo " - Publish to crates.io"
482431echo " "
483432echo -e " ${CYAN} Users can install with:${NC} "
484- if [ " $PUBLISH_CRATES " = true ]; then
485- echo " "
486- echo " # From crates.io"
487- echo " [dependencies]"
488- echo " gopher-orch = \" $CARGO_VERSION \" "
489- fi
433+ echo " "
434+ echo " # From crates.io"
435+ echo " [dependencies]"
436+ echo " gopher-orch = \" $CARGO_VERSION \" "
490437echo " "
491438echo " # From GitHub"
492439echo " [dependencies]"
0 commit comments