diff --git a/RELEASE.md b/RELEASE.md index 9a1e89f..070fbe4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -80,7 +80,16 @@ Once we are confident that the release will be out shortly, and doesn't need any ### macOS Release -This needs to happen for both Silicon and Intel chipsets. +> [!TIP] +> You can automate these steps from your macOS terminal app with: +> +> ``` +> doit clean +> doit -n 8 apple_id= # for Intel macOS +> doit -n 8 apple_id= macos_build_dmg # for Apple Silicon macOS +> ``` + +The following needs to happen for both Silicon and Intel chipsets. #### Initial Setup @@ -221,12 +230,17 @@ Rename `Dangerzone.msi` to `Dangerzone-$VERSION.msi`. ### Linux release -> [!INFO] -> Below we explain how we build packages for each Linux distribution we support. +> [!TIP] +> You can automate these steps from any Linux distribution with: > -> There is also a `release.sh` script available which creates all -> the `.rpm` and `.deb` files with a single command. +> ``` +> doit clean +> doit -n 8 fedora_rpm debian_deb +> ``` +> +> You can then add the created artifacts to the appropriate APT/YUM repo. +Below we explain how we build packages for each Linux distribution we support. #### Debian/Ubuntu @@ -268,7 +282,7 @@ or create your own locally with: ./dev_scripts/env.py --distro fedora --version 41 build-dev # Build the latest container (skip if already built): -./dev_scripts/env.py --distro fedora --version 41 run --dev bash -c "cd dangerzone && poetry run ./install/common/build-image.py" +./dev_scripts/env.py --distro fedora --version 41 run --dev bash -c "cd dangerzone && poetry run ./install/common/build-image.py" # Create a .rpm: ./dev_scripts/env.py --distro fedora --version 41 run --dev bash -c "cd dangerzone && ./install/linux/build-rpm.py" diff --git a/docs/developer/doit.md b/docs/developer/doit.md new file mode 100644 index 0000000..e702eff --- /dev/null +++ b/docs/developer/doit.md @@ -0,0 +1,58 @@ +# Using the Doit Automation Tool + +Developers can use the [Doit](https://pydoit.org/) automation tool to create +release artifacts. The purpose of the tool is to automate our manual release +instructions in `RELEASE.md` file. Not everything is automated yet, since we're +still experimenting with this tool. You can find our task definitions in this +repo's `dodo.py` file. + +## Why Doit? + +We picked Doit out of the various tools out there for the following reasons: + +* **Pythonic:** The configuration file and tasks can be written in Python. Where + applicable, it's easy to issue shell commands as well. +* **File targets:** Doit borrows the file target concept from Makefiles. Tasks + can have file dependencies, and targets they build. This makes it easy to + define a dependency graph (DAG) for tasks. +* **Hash-based caching:** Unlike Makefiles, doit does not look at the + modification timestamp of source/target files, to figure out if it needs to + run them. Instead, it hashes those files, and will run a task only if the + hash of a file dependency has changed. +* **Parallelization:** Tasks can be run in parallel with the `-n` argument, + which is similar to `make`'s `-j` argument. + +## How to Doit? + +First, enter your Poetry shell. Then, make sure that your environment is clean, +and you have ample disk space. You can run: + +```bash +doit clean --dry-run # if you want to see what would happen +doit clean # you'll be asked to cofirm that you want to clean everything +``` + +Finally, you can build all the release artifacts with `doit`, or a specific task +with: + +``` +doit +``` + +## Tips and tricks + +* You can run `doit list --all -s` to see the full list of tasks, their + dependencies, and whether they are up to date. +* You can run `doit info ` to see which dependencies are missing. +* You can change this line in `pyproject.toml` to `true`, to allow using the + Docker/Podman build cache: + + ``` + use_cache = true + ``` + +* You can pass the following global parameters with `doit =`: + - `runtime`: The container runtime to use. Either `podman` or `docker` + - `release_dir`: Where to store the release artifacts. Default path is + `~/release-assets/` + - `apple_id`: The Apple ID to use when signing/notarizing the macOS DMG.