diff options
| -rw-r--r-- | release.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/release.sh b/release.sh new file mode 100644 index 0000000..08ee5fe --- /dev/null +++ b/release.sh | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | |||
| 4 | # Release script for the MAT | ||
| 5 | |||
| 6 | |||
| 7 | echo "Previous version: $(git describe --abbrev=0)" | ||
| 8 | echo "Please enter the new version number" | ||
| 9 | read VERSION | ||
| 10 | |||
| 11 | echo '[+] Update version number' | ||
| 12 | sed s/__version__\ =\ \'[0-9\.]*\'/__version__\ =\ \'${VERSION}\'/ MAT/mat.py # > mat.py | ||
| 13 | sed s/__version__\ =\ \'[0-9\.]*\'/__version__\ =\ \'${VERSION}\'/ setup.py # > mat.py | ||
| 14 | |||
| 15 | echo '[+] Update changelog' | ||
| 16 | vim -O CHANGELOG <(git log --graph --pretty=format:'%h -%d %s (%cr) )<%an>' --abbrev-commit --date=relative) | ||
| 17 | |||
| 18 | echo '[+] Commit the changelog' | ||
| 19 | git commit CHANGELOG MAT/mat.py setup.py -m 'Update changelog and bump version' | ||
| 20 | |||
| 21 | echo '[+] Create a tag' | ||
| 22 | git tag -s ${VERSION} | ||
| 23 | |||
| 24 | echo '[+] Push the tag' | ||
| 25 | git push --tags origin | ||
| 26 | |||
| 27 | echo '[+] Create the release archive' | ||
| 28 | git archive --format=tar.gz --prefix=mat-${VERSION}/ ${VERSION} > mat-${VERSION}.tar.gz | ||
| 29 | |||
| 30 | echo '[+] Sign the archive' | ||
| 31 | gpg --armor --detach-sign mat-${VERSION}.tar.gz | ||
| 32 | |||
| 33 | # Recall | ||
| 34 | echo '[+] Release done' | ||
| 35 | echo "[*] Don't forget to:" | ||
| 36 | echo "\t- Upload archives to https://mat.boum.org/files" | ||
| 37 | echo "\t- Add changelog to https://mat.boum.org/" | ||
| 38 | echo "\t- Have a nice day" | ||
