Add the argument release to build script to actually release

This commit is contained in:
Gabe Kangas
2020-08-30 12:03:28 -07:00
parent aaeea2bb1d
commit b2ba9a2fcb

View File

@@ -9,6 +9,7 @@ ARCH=(amd64 amd64)
# Version # Version
VERSION=$1 VERSION=$1
SHOULD_RELEASE=$2
if [[ -z "${VERSION}" ]]; then if [[ -z "${VERSION}" ]]; then
echo "Version must be specified when running build" echo "Version must be specified when running build"
@@ -64,29 +65,35 @@ for i in "${!DISTRO[@]}"; do
build ${DISTRO[$i]} ${OS[$i]} ${ARCH[$i]} $VERSION $GIT_COMMIT build ${DISTRO[$i]} ${OS[$i]} ${ARCH[$i]} $VERSION $GIT_COMMIT
done done
# Create the tag # Use the second argument "release" to create an actual release.
# git tag -a "v${VERSION}" -m "Release build v${VERSION}" if [ "$SHOULD_RELEASE" != "release" ]; then
echo "Not creating a release."
exit
fi
# # On macOS open the Github page for new releases so they can be uploaded # Create the tag
# if test -f "/usr/bin/open"; then git tag -a "v${VERSION}" -m "Release build v${VERSION}"
# open "https://github.com/gabek/owncast/releases/new"
# open dist # On macOS open the Github page for new releases so they can be uploaded
# fi if test -f "/usr/bin/open"; then
open "https://github.com/gabek/owncast/releases/new"
open dist
fi
# Docker build # Docker build
# Must authenticate first: https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages # Must authenticate first: https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages
# DOCKER_IMAGE="owncast-${VERSION}" DOCKER_IMAGE="owncast-${VERSION}"
# echo "Building Docker image ${DOCKER_IMAGE}..." echo "Building Docker image ${DOCKER_IMAGE}..."
#
# # Change to the root directory of the repository # Change to the root directory of the repository
# cd $(git rev-parse --show-toplevel) cd $(git rev-parse --show-toplevel)
#
# Github Packages # Github Packages
# docker build --build-arg NAME=docker --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=$GIT_COMMIT -t owncast . -f scripts/Dockerfile-build docker build --build-arg NAME=docker --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=$GIT_COMMIT -t owncast . -f scripts/Dockerfile-build
# docker tag $DOCKER_IMAGE docker.pkg.github.com/gabek/owncast/$DOCKER_IMAGE:$VERSION docker tag $DOCKER_IMAGE docker.pkg.github.com/gabek/owncast/$DOCKER_IMAGE:$VERSION
# docker push docker.pkg.github.com/gabek/owncast/$DOCKER_IMAGE:$VERSION docker push docker.pkg.github.com/gabek/owncast/$DOCKER_IMAGE:$VERSION
# #
# Dockerhub # Dockerhub
# You must be authenticated via `docker login` with your Dockerhub credentials first. # You must be authenticated via `docker login` with your Dockerhub credentials first.
# docker tag owncast gabekangas/owncast:$VERSION docker tag owncast gabekangas/owncast:$VERSION
# docker push gabekangas/owncast docker push gabekangas/owncast