- Python 76%
- Nix 9%
- Shell 9%
- HCL 4%
- Docker 2%
Release Pipeline #
Automated release pipeline for lichen. Builds static musl binaries, creates Codeberg releases, pushes Docker images, updates YunoHost and Helm packages.
Quick start #
ssh root@release-runner # or ssh root@100.67.126.34
cd /root/lichen
git pull origin main # get latest code
/root/run-release.sh run <version>
Example: /root/run-release.sh run 0.2.0
First-time setup on the release runner #
1. Create .env #
cp /root/lichen/release/.env.example /root/lichen/release/.env
Fill in:
CODEBERG_TOKEN=<your notplants codeberg API token>
DOCKER_USERNAME=notplants
DOCKER_PASSWORD=<your docker hub token>
To create a Codeberg token: https://codeberg.org/user/settings/applications
(needs write:repository scope).
2. Set the git origin with token auth #
The pipeline pushes tags and helm chart updates to Codeberg via HTTPS. The origin remote needs your token embedded:
cd /root/lichen
git remote set-url origin https://notplants:<CODEBERG_TOKEN>@codeberg.org/notplants/lichen.page.git
3. Set up tangled SSH key (optional) #
If you want tags pushed to tangled too, add an SSH key to the VM that has push access:
ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519 -N "" -C "release-runner"
cat /root/.ssh/id_ed25519.pub
# Add this key to your tangled account
Making a release #
1. Prepare #
ssh root@release-runner
cd /root/lichen
git pull origin main
Make sure HEAD is the commit you want to release.
2. Run the pipeline #
/root/run-release.sh run <version>
Pass the version without a v prefix. The pipeline adds it automatically.
Example: /root/run-release.sh run 0.2.0 creates tag v0.2.0.
3. What happens #
The pipeline runs these steps in order:
-
Build — cross-compiles 4 static (musl)
lichenbinaries:minimum(no optional features) × x86_64, aarch64full(shell, git, atproto, oidc, hugo, mdbook) × x86_64, aarch64- Binaries are gzip-compressed
-
Codeberg — creates git tag
v<version>, pushes to origin and tangled, creates a Codeberg release, uploads all 4 compressed binaries as assets -
Docker — builds and pushes two Docker images to Docker Hub:
notplants/lichen-min:<version>(Alpine + minimum binary)notplants/lichen-full:<version>(Alpine + full binary + hugo, git, bubblewrap)
-
YunoHost — updates
manifest.tomlandapps.jsonin ther-lichen_ynhpackage repo with new version, URLs, and checksums -
Helm — updates
Chart.yamlappVersion andvalues.yamlimage tag, commits and pushes to the main repo -
Tauri (optional) — builds Linux desktop app (.deb, .rpm) if
cargo-tauriis installed
4. If something fails #
The pipeline is idempotent and resumable. Just rerun the same command:
/root/run-release.sh run <version>
It checks state.json and skips completed steps. To force a full re-run:
/root/run-release.sh run <version> --force
5. Verify #
- Codeberg release:
https://codeberg.org/notplants/lichen.page/releases/tag/v<version> - Docker:
docker pull notplants/lichen-full:<version> - Helm: check
charts/lichen/values.yamlin the repo
Running individual steps #
/root/run-release.sh build <version> # just compile binaries
/root/run-release.sh publish <version> # just create release + upload
/root/run-release.sh docker <version> # just build + push docker
/root/run-release.sh ynh <version> # just update yunohost package
/root/run-release.sh helm <version> # just update helm chart
/root/run-release.sh tauri <version> # just build desktop app
Test mode #
To test against disposable test accounts:
RELEASE_MODE=test /root/run-release.sh run 0.0.1-test
This uses nptest Codeberg account and nptest2 Docker Hub account.
Requires test credentials in .env.
What's where #
| Path | Purpose |
|---|---|
/root/run-release.sh |
Wrapper script (sets PATH and RELEASE_MODE) |
/root/lichen/release/.env |
Credentials (not in git) |
/root/lichen/release/release/ |
Python pipeline scripts |
/root/lichen/release/releases/<version>/ |
Built binaries |
/root/lichen/release/state.json |
Pipeline state (which steps completed) |
/root/lichen/release/logs/<version>.log |
Build logs |
/root/lichen/release/docker/Dockerfile.prebuilt |
Docker image definition |
/root/lichen/release/packages/lichen_ynh/ |
Cloned YunoHost package repo |
Production repos #
| What | Location |
|---|---|
| Codeberg | notplants/lichen |
| Tangled | notplants.bsky.social/r-lichen |
| Docker Hub | notplants/lichen-min, notplants/lichen-full |
| YunoHost | notplants/r-lichen_ynh (on Codeberg) |
| Helm chart | charts/lichen/ in the main repo |
Unified executable #
Release assets are lichen-{minimum,full}-{x86_64,aarch64}-linux.gz.
Both variants build lichen-cli --bin lichen --no-default-features; only the
full variant adds the configured optional features. Docker installs
/usr/local/bin/lichen. The minimal image runs lichen server --site /data run;
the full image runs lichen server --multi --root-dir /data run.
Use matching deployment entrypoints when adopting the new assets. The YunoHost
step also migrates the package executable name, service, and install/upgrade/restore
scripts to the unified commands. Existing releases retain their original names.
Run the focused release-contract tests with python3 -m unittest discover -s tests.