diff --git a/README.md b/README.md new file mode 100644 index 0000000..cd2b58c --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# deb-notifier + +Debian package for the [lib-shared-models](https://git.gansejunge.com/notifier/lib-shared-models). +This repository contains no application code, only the packaging and the CI that builds and +publishes the `.deb`. + +## How a release happens + +``` +tag vX.Y.Z in lib-shared-models + -> .gitea/workflows/trigger-deb.yaml (dispatches the workflow below) + -> .gitea/workflows/shared-models-release.yaml in this repo + 1. downloads the source archive of the tag + 2. make -> build/python3-shared-models_X.Y.Z-1_all.deb + 3. uploads it to the Gitea Debian registry +``` + +To release a new app version, tag it in `lib-shared-models` (`git tag v1.0.1 && git push --tags`). +Nothing needs to be done here. + +To rebuild a version without a new tag (for example after changing the packaging), run the +**shared-models-release** workflow manually from the Actions tab and increase `revision`. +The registry rejects a version/revision pair that already exists (HTTP 409). + +## Repository layout + +``` +Makefile +pkg/ + DEBIAN/ + control Version: @VERSION@ is replaced at build time, do not hardcode it + postinst compiles the source code into bytes via py3compile + prerm removes the compiled code +``` + +The Python files are not stored here. The Makefile copies them from the source checkout +into a staging directory. + +## Build locally + +Needs `make` and `dpkg-deb`. + +```bash +make VERSION=0.0.0 REVISION=1 +dpkg-deb -I build/*.deb # control file +dpkg-deb -c build/*.deb # file list +sudo apt install ./build/python3-shared-models_0.0.0-1_all.deb +``` + +| Variable | Default | Purpose | +|---|---|---| +| `VERSION` | none, required | App version without the `v` | +| `REVISION` | `1` | Packaging revision | +| `SRC_DIR` | `src` | Folder containing the Python files | + +`make clean` removes `build/`. + +## Troubleshooting + +- **Upload returns 409**: that version and revision are already published. Bump `revision` or use a new tag. \ No newline at end of file