prevent releases from non-master branches

This commit is contained in:
Nick Sweeting 2020-07-28 07:06:14 -04:00
parent 9248ff5890
commit ac72423886

View file

@ -34,18 +34,18 @@ cd "$DIR/docs"
make html make html
cd "$DIR" cd "$DIR"
# if [ -z "$(git status --porcelain)" ] && [[ "$(git branch --show-current)" == "master" ]]; then if [ -z "$(git status --porcelain)" ] && [[ "$(git branch --show-current)" == "master" ]]; then
# git pull git pull
# else else
# echo "[X] Commit your changes and make sure git is checked out on clean master." echo "[X] Commit your changes and make sure git is checked out on clean master."
# exit 4 exit 4
# fi fi
echo "[*] Bumping VERSION from $OLD_VERSION to $NEW_VERSION" echo "[*] Bumping VERSION from $OLD_VERSION to $NEW_VERSION"
echo "$NEW_VERSION" > "$VERSION_FILE" echo "$NEW_VERSION" > "$VERSION_FILE"
git add "$NEW_VERSION" git add "$VERSION_FILE"
git commit -m "$NEW_VERSION release" git commit -m "$NEW_VERSION release"
git tag -a "$NEW_VERSION" git tag -a "v$NEW_VERSION" -m "v$NEW_VERSION"
git push origin master git push origin master
git push origin --tags git push origin --tags
@ -63,12 +63,18 @@ echo "[^] Uploading to pypi.org"
python3 -m twine upload --repository pypi dist/* python3 -m twine upload --repository pypi dist/*
echo "[+] Building docker image" echo "[+] Building docker image"
docker build . -t "archivebox,archivebox:latest,archivebox:$NEW_VERSION,nikisweeting/archivebox,docker.pkg.github.com/pirate/ArchiveBox/archivebox:$NEW_VERSION" docker build . -t archivebox \
-t archivebox:latest \
-t archivebox:$NEW_VERSION \
-t docker.io/nikisweeting/archivebox:latest \
-t docker.io/nikisweeting/archivebox:$NEW_VERSION \
-t docker.pkg.github.com/pirate/archivebox/archivebox:latest \
-t docker.pkg.github.com/pirate/archivebox/archivebox:$NEW_VERSION
echo "[^] Uploading docker image" echo "[^] Uploading docker image"
# docker login --username=nikisweeting # docker login --username=nikisweeting
# docker login docker.pkg.github.com --username=pirate # docker login docker.pkg.github.com --username=pirate
docker push nikisweeting/archivebox docker push docker.io/nikisweeting/archivebox
docker push docker.pkg.github.com/pirate/ArchiveBox/archivebox:$NEW_VERSION docker push docker.pkg.github.com/pirate/archivebox/archivebox
echo "[√] Done. Published version v$NEW_VERSION" echo "[√] Done. Published version v$NEW_VERSION"