Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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:

AssetBuilt from
tether_<version>-1_amd64.debthe desktop/ workspace: tetherd, tether and tether-cli in one package
tether-<version>-linux-x86_64.tar.gzthe same programs and files with install.sh, for distributions without a Debian package (from 0.5.0)
tether-android-<version>.apkandroid/, signed with the project key
SHA256SUMSchecksums 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 main in which every feature that ships is documented and listed under “Unreleased” in CHANGELOG.md.

Cut a release

  1. Bump the version in two files:

    FileField
    desktop/Cargo.tomlversion under [workspace.package], which all six crates inherit
    android/app/build.gradle.ktsversionName (the same string) and versionCode (an integer that increases by one with every release)

    Build the desktop workspace once so that desktop/Cargo.lock picks up the new version, and commit the lock file with the bump.

  2. 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”.

  3. 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.

  4. 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 --workspace
    
    cd android
    ./gradlew :app:testDebugUnitTest :app:assembleDebug
    
  5. Commit as chore(release): <version>, push to main, and wait until all workflows are green.

  6. Create an annotated tag whose name starts with v and push it:

    git tag -a v<version> -m "<message>"
    git push origin v<version>
    
  7. Wait for the tag’s workflows. They create a draft release for the tag and attach the assets to it (see What CI builds).

  8. 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
    
  9. Check the draft: the three assets are present, the APK is signed with the project key (signer certificate SHA-256 dd87db65274499ba7aab364bce0bf70662dca61de6e2119ba4f97b56288c57cf), the .deb installs on a clean supported system, and ./install.sh --check from the unpacked tarball reports no program that cannot start.

  10. 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.

WorkflowJobStepsResult
desktop.ymldeb, after checkcargo 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-builddesktop/target/debian/*.deb as artefact tether-deb and desktop/target/tarball/*.tar.gz as artefact tether-tarball, both attached to the draft release
android.ymlrelease, after builddecodes the keystore, ./gradlew --no-daemon --stacktrace :app:assembleRelease, copies the APK to dist/tether-android-<version>.apk, writes SHA256SUMS for it, deletes the keystoreboth 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:

ValueEnvironment variableKey in keystore.properties
Path of the keystore fileTETHER_KEYSTORE_PATHstoreFile
Keystore passwordTETHER_KEYSTORE_PASSWORDstorePassword
Key aliasTETHER_KEY_ALIASkeyAlias
Key passwordTETHER_KEY_PASSWORDkeyPassword

Warning

Never commit a keystore or keystore.properties. The repository’s .gitignore excludes *.jks, *.keystore and keystore.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:

SecretContents
ANDROID_KEYSTORE_BASE64the keystore file, base64-encoded
ANDROID_KEYSTORE_PASSWORDthe keystore password
ANDROID_KEY_ALIASthe key alias
ANDROID_KEY_PASSWORDthe 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

  1. 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 four TETHER_* variables in the shell that runs Gradle.

  2. Build:

    cd android
    ./gradlew :app:assembleRelease
    

    The 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.