As part of the Sleep Diary Project, this manages the build environment used by other repositories.
See the getting started guide if you would like to run the internal tools on your computer. Tools are rebuilt automatically every 30 days, so you should only need to use this repository directly if you're maintaining the Sleep Diary Project itself.
This procedure should only be necessary if you need to e.g. improve the error messages printed by the build process. If you're developing individual repositories, the getting started guide has everything you need.
To build the tools locally, do:
/path/to/sleepdiary/internal-tools/bin/run.sh build-local
This command builds local copies of the sleepdiaryproject/*
containers, so it's not designed run inside a container itself. That means you need to install Docker (or an equivalent), curl
, git
and possibly some other common development packages.
Once you've tested your changes locally, create a pull request in the normal way. If and when your PR is accepted, main.yml
will publish your changes to the pre-release
tags in our GitHub Packages repository. Other repositories use the latest
tag, so this will not affect them.
Containers are configured a bit differently on GitHub's servers than when run locally. For example, actions can use a different working directory than we expect. Once your pre-release has been published, configure your local forks to test the new tag:
cd /path/to/sleepdiary/repo
# update the tag:
sed -i -e "s/builder:latest/builder:pre-release/g" .github/workflows/*.yml
# commit your changes:
git commit .github/workflows/*.yml \
-m 's/builder:latest/builder:pre-release/g' \
-m "Actual command:" \
-m $'\tsed -i -e "s/builder:latest/builder:pre-release/g" .github/workflows/*.yml'
# push to your local fork:
git push safe-personal
Once you have pushed all the changes, do manual test runs of all the workflows in each of your forked repositories. If everything works, reset all your repositories:
cd /path/to/sleepdiary/repo
git reset --hard unsafe-canonical/main
git push --force safe-personal unsafe-canonical/main:main
Once you have confirmed the new tag won't break anything, create a new planned maintenance issue and create a PR to pull latest
🠔 main
. The steps to take during maintenance should be something like:
- Accept the PR
- Publish Docker images
- Go to the autobuild action
- click the grey Run workflow button
- click the green Run workflow button
- Run a test build for every repository