mirror of
https://github.com/QuasarApp/pe-parse.git
synced 2025-04-26 12:24:32 +00:00
Massages the pe-parse build into a format that's more accomodating for vcpkg, in preparation for imminent packaging.
36 lines
902 B
Bash
Executable File
36 lines
902 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# release: perform the chore work required for a pe-parse/pepy release
|
|
|
|
set -eo pipefail
|
|
|
|
function installed {
|
|
cmd=$(command -v "${1}")
|
|
|
|
[[ -n "${cmd}" ]] && [[ -f "${cmd}" ]]
|
|
return ${?}
|
|
}
|
|
|
|
function die {
|
|
>&2 echo "Barf: ${*}"
|
|
exit 1
|
|
}
|
|
|
|
# Fail early if we don't have the expected tools.
|
|
installed git || die "Missing dependency: git"
|
|
|
|
# Fail early if `git status` reports any untracked changes.
|
|
[[ -n $(git status -s) ]] && die "Untracked changes in repo"
|
|
|
|
# Next, check the VERSION in version and make sure it doesn't already have a git tag.
|
|
[[ -f ./VERSION ]] || die "Missing VERSION file; wrong directory?"
|
|
version=v$(<./VERSION)
|
|
[[ -n $(git tag -l "${version}") ]] && die "git tag for ${version} already exists!"
|
|
|
|
# Next, craft a tag for the current HEAD. Push both the current commit and the tag.
|
|
git tag "${version}"
|
|
git push
|
|
git push origin "${version}"
|
|
|
|
echo OK
|