Package and release
This page is for maintainers. It shows how to cut a release and how to build the Debian package, the tarball and a signed APK on your own machine.
A release is these files, attached to one GitHub release of
tetheron/tetheron:
| Asset | Built from |
|---|---|
tether_<version>-1_amd64.deb | the desktop/ workspace: tetherd, tether and tether-cli in one package |
tether-<version>-linux-x86_64.tar.gz | the same programs and files with install.sh, for distributions without a Debian package (from 0.5.0) |
tether-android-<version>.apk | android/, signed with the project key |
SHA256SUMS | checksums of the three files |
GitHub releases are the only distribution channel. A Flatpak is planned (see the roadmap).
Versions follow Semantic Versioning. Before 1.0 a minor bump marks a feature release and may extend the wire protocol additively.
Before you begin
You need:
- push access to the repository and the
GitHub CLI (
gh), signed in, - the signing secrets set in the repository (see Sign the APK),
- a tree on
mainin which every feature that ships is documented and listed under “Unreleased” inCHANGELOG.md.
Cut a release
-
Bump the version in two files:
File Field desktop/Cargo.tomlversionunder[workspace.package], which all six crates inheritandroid/app/build.gradle.ktsversionName(the same string) andversionCode(an integer that increases by one with every release)Build the desktop workspace once so that
desktop/Cargo.lockpicks up the new version, and commit the lock file with the bump. -
Update
CHANGELOG.md: rename the “Unreleased” section to## [<version>] - <YYYY-MM-DD>, start a new empty “Unreleased” section if work continues, and add the compare link at the end of the file:[<version>]: https://github.com/tetheron/tetheron/compare/v<previous>...v<version>List what was not verified on a real phone under “Known limitations” or “Notes”.
-
Update the pages that name the current release: the status line and the “Available now” column in
README.md, the status of the shipped rows in the feature table, and the milestone’s status paragraph in the roadmap. -
Run the checks with the toolchain CI uses. CI takes the latest stable Rust, so update first:
rustup update stable cd desktop cargo fmt --all --check cargo clippy --workspace --all-targets -- -D warnings cargo test --workspacecd android ./gradlew :app:testDebugUnitTest :app:assembleDebug -
Commit as
chore(release): <version>, push tomain, and wait until all workflows are green. -
Create an annotated tag whose name starts with
vand push it:git tag -a v<version> -m "<message>" git push origin v<version> -
Wait for the tag’s workflows. They create a draft release for the tag and attach the assets to it (see What CI builds).
-
Regenerate
SHA256SUMS. The file that CI attaches lists only the APK. Download the three assets from the draft release into an empty directory, then run there:sha256sum tether-android-<version>.apk tether_<version>-1_amd64.deb \ tether-<version>-linux-x86_64.tar.gz > SHA256SUMS gh release upload v<version> SHA256SUMS --clobber -
Check the draft: the three assets are present, the APK is signed with the project key (signer certificate SHA-256
dd87db65274499ba7aab364bce0bf70662dca61de6e2119ba4f97b56288c57cf), the.debinstalls on a clean supported system, and./install.sh --checkfrom the unpacked tarball reports no program that cannot start. -
Publish. Replace the placeholders with the title and a file that holds the release notes:
gh release edit v<version> --title "<title>" --notes-file <file> --draft=false --latest
What CI builds
Pushing a tag that matches v* runs the normal checks and then one release
job in each workflow.
| Workflow | Job | Steps | Result |
|---|---|---|---|
desktop.yml | deb, after check | cargo install cargo-deb --locked, cargo build --release --workspace, cargo deb -p tetherd --no-build, lintian (informational, never fails the job), packaging/build-tarball.sh --no-build | desktop/target/debian/*.deb as artefact tether-deb and desktop/target/tarball/*.tar.gz as artefact tether-tarball, both attached to the draft release |
android.yml | release, after build | decodes the keystore, ./gradlew --no-daemon --stacktrace :app:assembleRelease, copies the APK to dist/tether-android-<version>.apk, writes SHA256SUMS for it, deletes the keystore | both files as artefact tether-android-release and attached to the draft release |
Both jobs run on Ubuntu 24.04, so the package and the tarball are built for
amd64 against the libraries of that release. The tarball’s programs
therefore need glibc 2.39, GTK 4.14 and libadwaita 1.5 or newer where they
run. Both attach to a draft release with generated
release notes. Nothing is public until you publish the draft.
If the secret ANDROID_KEYSTORE_BASE64 is not set, the Android release job
prints a notice and skips the build. The draft then has no APK.
Build the Debian package locally
Build, inspect and install the package as described in
Build, run and install from source. Arguments you give to
desktop/packaging/build-deb.sh are passed on to cargo deb. After a change
to the systemd unit, reload and verify it:
systemctl --user daemon-reload
systemctl --user restart tetherd
systemd-analyze --user verify /usr/lib/systemd/user/tetherd.service
The package’s metadata (dependencies, description, the list of installed
files) is in [package.metadata.deb] at the end of
desktop/crates/tetherd/Cargo.toml. When you add a file to the package,
add it to the assets list there, to the tarball (see the next section)
and to the table in
desktop/packaging/README.md.
Build the tarball locally
desktop/packaging/build-tarball.sh
The script runs cargo build --release --workspace and writes
desktop/target/tarball/tether-<version>-linux-<arch>.tar.gz. With
--no-build it packs the programs that are already in target/release/.
It fails when install.sh lists a file that is not in the tarball.
The list of installed files is the function payload in
desktop/packaging/tarball/install.sh. When you add a file to the Debian
package, add it there and to build-tarball.sh as well. The package lists
for Fedora and Arch Linux are at the top of install.sh. The same lists are
in README.md, in desktop/packaging/tarball/README.md and in
Install Tetheron on Linux. The package
names that the programs show in their hints are in
desktop/crates/tether-distro/src/lib.rs.
To try the script without touching the system, unpack the tarball and stage an installation:
DESTDIR=/tmp/tether-stage ./install.sh
DESTDIR=/tmp/tether-stage ./install.sh --uninstall
Sign the APK
android/app/build.gradle.kts signs the release build when it finds a
keystore, and builds an unsigned release APK when it does not. It reads four
values, each from an environment variable first and from
android/keystore.properties second:
| Value | Environment variable | Key in keystore.properties |
|---|---|---|
| Path of the keystore file | TETHER_KEYSTORE_PATH | storeFile |
| Keystore password | TETHER_KEYSTORE_PASSWORD | storePassword |
| Key alias | TETHER_KEY_ALIAS | keyAlias |
| Key password | TETHER_KEY_PASSWORD | keyPassword |
Warning
Never commit a keystore or
keystore.properties. The repository’s.gitignoreexcludes*.jks,*.keystoreandkeystore.properties. An APK signed with a different key cannot update an installed app, so a lost key cannot be replaced.
In CI
The release job expects four repository secrets:
| Secret | Contents |
|---|---|
ANDROID_KEYSTORE_BASE64 | the keystore file, base64-encoded |
ANDROID_KEYSTORE_PASSWORD | the keystore password |
ANDROID_KEY_ALIAS | the key alias |
ANDROID_KEY_PASSWORD | the key password |
The job decodes the keystore into the runner’s temporary directory, passes
the values to Gradle through the TETHER_* environment variables, and
removes the file when it ends.
On your machine
-
Create
android/keystore.properties:storeFile=<path to the keystore file> storePassword=<keystore password> keyAlias=<key alias> keyPassword=<key password>Use an absolute path for
storeFile. Alternatively, export the fourTETHER_*variables in the shell that runs Gradle. -
Build:
cd android ./gradlew :app:assembleReleaseThe APK is written to
android/app/build/outputs/apk/release/.
The release build is minified with R8. A debug build and a release build are signed with different keys, so one must be uninstalled before the other can be installed, and the phone must then be paired again.
A fork that publishes its own builds uses its own key. Its APK cannot replace an installed APK that was signed with the project key.