|
| 1 | +# usage: ./release/release.sh [new version string] |
| 2 | +# for example: ./release/release.sh 1.0.0 |
| 3 | + |
| 4 | +# update version string for libmongoc handshake |
| 5 | +sourcery --sources Sources/MongoSwift --templates Sources/MongoSwift/MongoSwiftVersion.stencil --output Sources/MongoSwift/MongoSwiftVersion.swift --args versionString=${1} |
| 6 | + |
| 7 | +# regenerate documentation with new version string |
| 8 | +export DOCSVERSION=${1} |
| 9 | +make documentation |
| 10 | + |
| 11 | +# commit changes |
| 12 | +git add docs/ |
| 13 | +git add Sources/MongoSwift/MongoSwiftVersion.swift |
| 14 | +git commit -m "${1}" |
| 15 | + |
| 16 | +# tag release |
| 17 | +git tag "v${1}" |
| 18 | + |
| 19 | +# push changes |
| 20 | +git push --tags |
| 21 | + |
| 22 | +# update podspec |
| 23 | +cat > ${PWD}/MongoSwift.podspec <<- EOF |
| 24 | +Pod::Spec.new do |spec| |
| 25 | + spec.name = "MongoSwift" |
| 26 | + spec.version = "${1}" |
| 27 | + spec.summary = "The Swift driver for MongoDB" |
| 28 | + spec.homepage = "https://github.com/mongodb/mongo-swift-driver" |
| 29 | + spec.license = 'Apache License, Version 2.0' |
| 30 | + spec.authors = { |
| 31 | + "Matt Broadstone" => "[email protected]", |
| 32 | + "Kaitlin Mahar" => "[email protected]", |
| 33 | + "Patrick Freed" => "[email protected]" |
| 34 | + } |
| 35 | +
|
| 36 | + spec.source = { |
| 37 | + :git => "https://github.com/mongodb/mongo-swift-driver.git", |
| 38 | + :tag => 'v${1}' |
| 39 | + } |
| 40 | +
|
| 41 | + spec.ios.deployment_target = "11.0" |
| 42 | + spec.tvos.deployment_target = "10.2" |
| 43 | + spec.watchos.deployment_target = "4.3" |
| 44 | +
|
| 45 | + spec.requires_arc = true |
| 46 | + spec.source_files = "Sources/MongoSwift/**/*.swift" |
| 47 | +
|
| 48 | + spec.dependency 'mongo-embedded-c-driver', '~> 1.13.0-4.0.0' |
| 49 | +end |
| 50 | +EOF |
| 51 | + |
| 52 | +# publish new podspec |
| 53 | +pod trunk push ${PWD}/MongoSwift.podspec |
| 54 | + |
| 55 | +# cleanup podspec |
| 56 | +rm ${PWD}/MongoSwift.podspec |
| 57 | + |
| 58 | +# go to GitHub to publish release notes |
| 59 | +open "https://github.com/mongodb/mongo-swift-driver/releases/tag/v${1}" |
0 commit comments