#!/usr/bin/env bash # Build a nightly using the helper Docker container. set -euo pipefail docker buildx build -t git.rgst.io/jaredallard/citron-nightly-builder --load . container_id=$(docker run --rm --detach --init --volume "citron-nightly-src:/src/citron-nightly" git.rgst.io/jaredallard/citron-nightly-builder sleep infinity) trap 'docker stop ${container_id}' EXIT echo "Using $container_id" docker exec "$container_id" build-nightly.sh rm -rf "builds" mkdir -p "builds" docker cp "$container_id:/root/builds/" "./builds/" # TODO(jaredallard): Unsure why this is happening. mv ./builds/builds/* ./builds/ rmdir builds/builds sudo chown "$(id -u):$(id -g)" "./builds/"* # # upload the artifacts # appimage_path=$(basename "$(find "./builds" -maxdepth 1 -name "*.AppImage" -print | head -n 1)") # release_name="${appimage_path//citron-/}" # release_name="${release_name//.AppImage/}" # echo "Create release $release_name" # fj --host git.rgst.io release --repo jaredallard/citron-nightly create \ # --create-tag --attach ./builds/"$appimage_path" "$release_name"