forked from andrebrait/1g1r-romset-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·32 lines (24 loc) · 970 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
RELEASE_VERSION="${1}"
NEXT_VERSION="${2}-SNAPSHOT"
ZIP_FILENAME="1g1r-romset-generator-${RELEASE_VERSION}.zip"
echo "Changing version to ${RELEASE_VERSION}"
sed -E -i.releaseBackup "s/^__version__ = .*$/__version__ = '${RELEASE_VERSION}'/" generate.py
echo "Committing changes"
git add generate.py
git commit -m "Release ${RELEASE_VERSION}"
echo "Generating tag ${RELEASE_VERSION}"
git tag -a "${RELEASE_VERSION}" -m "Release ${RELEASE_VERSION}"
echo "Pushing changes"
git push --follow-tags
echo "Generating compressed archive ${ZIP_FILENAME}"
[ -f "${ZIP_FILENAME}" ] && rm "${ZIP_FILENAME}" 2>/dev/null
zip -r "${ZIP_FILENAME}" generate.py LICENSE README.md headers modules -x "*__pycache__*"
echo "Changing version to ${NEXT_VERSION}"
sed -E -i "s/^__version__ = .*$/__version__ = '${NEXT_VERSION}'/" generate.py
echo "Committing changes"
git add generate.py
git commit -m "Bump version to ${NEXT_VERSION}"
git push