citron-nightly/run.sh
Jared Allard 98c930d692
initial commit
Largely based off of citron-appimage-builder, but for running
automatically nightly. Sorry for the cursed bash, I primarily wrote this
for speed over quality.
2025-03-13 15:13:17 -07:00

30 lines
998 B
Bash
Executable file

#!/usr/bin/env bash
# Build a nightly using the helper Docker container.
set -euo pipefail
docker buildx build -t builder --load .
container_id=$(docker run --rm --detach --init --volume "citron-nightly-src:/src/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"