|
| 1 | +#!/bin/bash |
| 2 | +set -Eeuo pipefail |
| 3 | + |
| 4 | +readonly branch=${branch:?"which branch to use"} |
| 5 | + |
| 6 | +main() { |
| 7 | + echo "### Releasing VimR started" |
| 8 | + |
| 9 | + pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null |
| 10 | + |
| 11 | + git submodule update --init |
| 12 | + |
| 13 | + ./bin/set_new_versions.sh |
| 14 | + |
| 15 | + # commit and push the tag |
| 16 | + # get the marketing version to be used as tag |
| 17 | + source release.spec.sh |
| 18 | + |
| 19 | + if [[ "${is_snapshot}" == true ]]; then |
| 20 | + tag_name="snapshot/${bundle_version}" |
| 21 | + else |
| 22 | + tag_name="${marketing_version}-${bundle_version}" |
| 23 | + fi |
| 24 | + echo "### Using ${tag_name} as tag name" |
| 25 | + git commit -am "Bump version to ${tag_name}" |
| 26 | + git tag -am "${tag_name}" |
| 27 | + git push |
| 28 | + git push origin "${tag_name}" |
| 29 | + |
| 30 | + echo "### Store release notes" |
| 31 | + echo "${release_notes}" > release-notes.temp.md |
| 32 | + |
| 33 | + echo "### Build VimR" |
| 34 | + |
| 35 | + # FOR DEV |
| 36 | + export create_gh_release=false |
| 37 | + export upload=false |
| 38 | + |
| 39 | + release_spec_file=release.spec.sh ./bin/build_release.sh |
| 40 | + |
| 41 | + if [[ "${create_gh_release}" == false ]]; then |
| 42 | + echo "### No github release, so exiting after building" |
| 43 | + exit 0 |
| 44 | + fi |
| 45 | + |
| 46 | + echo "### Commit appcast" |
| 47 | + if [[ "${update_appcast}" == true ]]; then |
| 48 | + if [[ "${is_snapshot}" == false ]]; then |
| 49 | + cp appcast.xml appcast_snapshot.xml |
| 50 | + fi |
| 51 | + |
| 52 | + git commit appcast* -m "Update appcast" |
| 53 | + git push |
| 54 | + fi |
| 55 | + |
| 56 | + popd >/dev/null |
| 57 | + |
| 58 | + echo "### Releasing VimR ended" |
| 59 | +} |
| 60 | + |
| 61 | +main |
| 62 | + |
0 commit comments