Browse Source

Add the argument release to build script to actually release

pull/146/head
Gabe Kangas 5 years ago
parent
commit
b2ba9a2fcb
  1. 41
      scripts/build.sh

41
scripts/build.sh

@ -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
# Use the second argument "release" to create an actual release.
if [ "$SHOULD_RELEASE" != "release" ]; then
echo "Not creating a release."
exit
fi
# Create the tag # Create the tag
# git tag -a "v${VERSION}" -m "Release build v${VERSION}" git tag -a "v${VERSION}" -m "Release build v${VERSION}"
# # On macOS open the Github page for new releases so they can be uploaded # On macOS open the Github page for new releases so they can be uploaded
# if test -f "/usr/bin/open"; then if test -f "/usr/bin/open"; then
# open "https://github.com/gabek/owncast/releases/new" open "https://github.com/gabek/owncast/releases/new"
# open dist open dist
# fi 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

Loading…
Cancel
Save