File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,16 @@ exit_code=0
44
55examples=(" BugReport" " Docs" " KituraExample" " PerfectExample" " VaporExample" " Atlas" )
66
7+ branch=${1}
8+ # Ensure branch is non-empty
9+ [ ! -z " ${branch} " ] || { echo " ERROR: Missing branch name" ; exit 1; }
10+
711for example_project in ${examples[@]} ; do
812 echo " Building $example_project "
913 example_dir=" Examples/${example_project} "
1014
11- # replace version string with main
12- etc/sed.sh -i ' s/swift-driver", .upToNextMajor[^)]*)/swift-driver", .branch("main ")/' " ${example_dir} /Package.swift"
15+ # replace version string with release branch name
16+ etc/sed.sh -i " s/swift-driver\ " , .upToNextMajor[^)]*)/swift-driver\ " , .branch(\" ${branch} \ " )/" " ${example_dir} /Package.swift"
1317
1418 pushd " ${example_dir} "
1519
@@ -32,6 +36,7 @@ for example_project in ${examples[@]}; do
3236 else
3337 echo " ================= Building $example_project failed ================="
3438 exit_code=1
39+ exit " ${exit_code} "
3540 fi
3641done
3742
Original file line number Diff line number Diff line change @@ -9,8 +9,9 @@ version=${1}
99# Ensure version is non-empty
1010[ ! -z " ${version} " ] || { echo " ERROR: Missing version string" ; exit 1; }
1111
12- # verify that the examples build
13- ./etc/build-examples.sh
12+ # verify that the examples build with the current branch we're releasing on
13+ current_branch=$( git branch --show-current)
14+ ./etc/build-examples.sh ${current_branch}
1415
1516# regenerate documentation with new version string
1617./etc/generate-docs.sh ${version}
@@ -30,7 +31,7 @@ git commit -m "${version} docs"
3031git push
3132
3233# go back to our original branch
33- git checkout -
34+ git checkout ${current_branch}
3435
3536# update version string for libmongoc handshake
3637sourcery --sources Sources/MongoSwift \
You can’t perform that action at this time.
0 commit comments