Introducing a new way to review your PRs.

Read the announcement

ismaelmartinez / teams-for-linux

Unofficial Microsoft Teams for Linux client

View on GitHub

23 documents · Updated Nov 23, 2026

docs / application-updates-and-packaging

Application updates and packaging

The packaging and update system turns one Electron application into platform packages and gives AppImage users an in-app path to new versions. It keeps version data and release notes aligned from release planning through package creation, then uses the right update channel for each distribution format. See the release packaging and quality parent page for the wider release gates and automated test coverage for the checks that protect this flow.

Packaging model

The application uses Electron Builder as the common packaging layer. It defines the application identity, the files and resources that ship, desktop integration, and the platform targets that turn the same app into installable products.

The package boundary also carries user-facing desktop behavior. It registers the msteams link scheme, includes sound assets, and keeps native spell-check data outside the main archive when required by the runtime. Linux packaging excludes the locally compiled cbor-extract build from the package so the portable dependency build remains available on older CPUs.

PlatformPackage formsMain delivery path
Linux.deb, .rpm, .tar.gz, AppImageGitHub release assets; AppImage also supports the in-app updater
Linux SnapSnap packages for x64 and arm64Snap Store channels
macOS.dmg and .zip for x64 and arm64GitHub release assets
Windowsx64 .exeGitHub release assets

References: package.json• L78-127 package.json• L129-207

Platform configuration

Platform settings adapt the application to each desktop system without changing its core product behavior. Linux metadata supplies the desktop category, executable identity, system libraries, and launch arguments. Snap adds strict confinement and the permissions needed for calls, media, and desktop access.

macOS packages use productivity metadata and camera and microphone usage text. The macOS build creates both CPU variants in one run so shared update metadata does not get replaced by a single-architecture build. Windows currently produces an x64 executable.

The package configuration is also a contract with distribution systems. Changes to target names, package names, dependencies, or desktop metadata must remain compatible with the release workflows and store checks that consume the resulting files.

References: package.json• L100-207 .github/…/build.yml• L240-357 .github/…/snap.yml• L17-149

Build hooks

Build hooks prepare release data and apply final package changes at defined points in the build. The pre-build step creates release information before packaging starts. The afterPack hook then completes Linux release preparation, applies the Snap launcher safeguard when needed, makes the packaged executable runnable, and enables the required Electron fuse setting.

The hook sequence is designed to fail the build when release data is not usable. Linux packaging therefore does not quietly produce an artifact with a missing version or missing notes. The same final hook also generates Debian package history from the shared release metadata. The compiled cbor-extract output is excluded during Linux packaging rather than removed after the package is assembled. This lets the dependency select a portable prebuilt module or its JavaScript fallback.

The build jobs install dependencies without running arbitrary lifecycle scripts, then run the one native-dependency setup step that Electron packaging needs. Release builds publish from main; pull request builds create artifacts without publishing them.

References: package.json• L21-52 package.json• L104-107 package.json• L204-207 scripts/afterpack.js• L25-73 .github/…/build.yml• L135-152

Release metadata

Release metadata is the shared description of an application version. The package version, lock-file version, AppStream release entry, changelog, and generated release information must describe the same release so package managers and GitHub can present a clear update.

The release workflow updates this chain in stages:

  1. Release Please prepares a draft release pull request from changes on main.
  2. The pull request updates the version, changelog, AppStream release entry, and lock file.
  3. The build reads the current release entry and creates the release information used by Linux publishing.
  4. Electron Builder publishes platform artifacts to the draft GitHub release after the release pull request is merged.

The AppStream update converts changelog bullets into plain release-note text and replaces an existing entry for the same version. This makes the operation safe to repeat and gives Linux software centers readable notes. The generated release information supplies the release name, date, and notes to the packaging system. Edge Snap versions may carry a short commit suffix in package.json; release checks remove that suffix when they compare the version with the lock file and AppStream data.

References: .github/…/release-please.yml• L12-23 .github/…/release-please.yml• L72-121 scripts/update-appdata-xml.js• L44-129 scripts/generateReleaseInfo.js• L31-105 scripts/afterpack.js• L54-73 release-please-config.json• L4-25 package.json• L1-3

Distribution workflow

Distribution moves a reviewed version from a release proposal to platform channels. The GitHub release is the common source for normal package assets, while Snap and Flatpak use follow-on workflows because their store paths need separate promotion or validation.

The following diagram shows the release and distribution path.

flowchart LR
    A[Changes on main] --> B[Release Please draft PR]
    B --> C[Release PR merged]
    C --> D[Platform builds]
    D --> E[Draft GitHub release]
    E --> F[Maintainer publishes release]
    F --> G[Snap candidate]
    F --> H[Flatpak validation]
    G --> I[Snap stable after testing]

The main build publishes Linux, macOS, and Windows artifacts only from main. A published GitHub release starts the tagged Snap build and uploads packages to the candidate channel. A separate Flatpak check uses the released Linux package and metadata to test the downstream store build path.

References: .github/…/build.yml• L120-152 .github/…/build.yml• L240-348 .github/…/snap-release.yml• L1-109 .github/…/flatpak-smoke.yml• L97-189

Desktop update workflow

The desktop updater provides a user-controlled update path for AppImage installations. It is inactive for Snap, deb, rpm, other package forms, and development runs because those formats use their package or store delivery systems.

When an AppImage starts, the updater checks silently for a newer version. If it finds one, the app asks the user whether to download and restart. A manual Check for Updates menu action is available only for AppImage users and reports either the current version or an error. The updater does not download in the background and does not install on quit without the user's choice.

This creates a short user flow:

  1. The running AppImage checks the release update service.
  2. The app shows the available version when one exists.
  3. The user selects Download & Restart or Later.
  4. The app downloads the update and restarts into the new version, or leaves the current version unchanged.

References: app/…/index.js• L10-99 app/…/README.md• L3-20 app/index.js• L703-811 app/…/appMenu.js• L31-43 app/…/index.js• L789-791

Update channels

Each package format follows the delivery system that owns its installation. AppImage checks GitHub release data from inside the app. Snap receives versions through store channels, while deb, rpm, macOS, Windows, and Flatpak users rely on their package or release distribution path.

User installationUpdate ownerUser-facing behavior
AppImageElectron updater and GitHub release metadataSilent startup check and optional download with restart
SnapSnap StoreEdge builds follow main; published releases enter candidate before manual stable promotion
deb, rpm, macOS, WindowsRelease assets and the user's package processNew files are published with the GitHub release
FlatpakFlathub packaging processRelease output is validated before downstream publication

The separation prevents two systems from trying to replace the same installation. It also means that changing a package target or release asset name can affect both artifact publication and the update path that consumes it.

References: app/…/index.js• L10-41 package.json• L115-127 package.json• L169-191 .github/…/snap.yml• L50-68 .github/…/snap-release.yml• L49-57 docs-site/…/manual-release-process.md• L21-32

Change checklist

When these files or sections are changed, remember to consider these:

  • When a package target, architecture, or artifact name changes, update the matching build job and every downstream workflow that downloads or publishes that artifact.
  • When version or release-note data changes, keep package.json, package-lock.json, com.github.IsmaelMartinez.teams_for_linux.appdata.xml, and generated release information compatible.
  • When the AppStream release shape changes, check both Linux release-note generation and Debian changelog generation.
  • When the AppImage update path changes, keep the AppImage-only guard, GitHub release metadata, user prompt, and restart behavior aligned.
  • When Snap packaging changes, review both the edge build and the tagged-release candidate build. Keep the arm64 toolchain constraint in view.
  • When macOS targets change, preserve one combined multi-architecture release build so shared update metadata is not overwritten.
  • When files or resources move, review the Electron Builder file allowlist and the final packaged-app launch check.
  • When the package version or edge-version format changes, keep the version comparison rules aligned with the lock file and AppStream release lookup.
  • When Linux dependency packaging changes, verify that the packaged cbor-extract path still selects a portable prebuilt module or the JavaScript fallback.

Important failure modes

TriggerConsequenceGuard
The package, lock file, and AppStream versions do not matchRelease information generation stops and Linux packaging does not produce a valid releasegenerateReleaseInfo checks the versions and strips only the supported edge suffix before comparison
The current version has no AppStream release entry or notesLinux publishing cannot describe the release and the build failsRelease metadata generation requires a matching dated entry with notes
A release build runs outside main with publishing enabledUnreviewed artifacts could reach the release destinationBuild workflows publish only on main and disable publishing for pull requests
The Electron Builder file allowlist omits a runtime fileThe package can build but the installed app can fail at startupThe Linux job smoke-launches the packaged app and checks navigation and missing-module errors
The AppImage updater is enabled for another package formatThe app may offer an update path that cannot replace the installed packageInitialization and the menu both require the APPIMAGE environment marker
The user declines an AppImage update or the download failsThe current app stays installed and the user must try again laterThe updater offers Later and shows an error only for manual failures or download errors
The Snap arm64 builder uses an incompatible Snapcraft versionThe arm64 package fails before it can reach the candidate channelThe release workflow pins the arm64 Snapcraft channel until the target migration is safe
Two separate macOS builds publish shared update metadataThe later build can replace the earlier architecture's metadataThe macOS release job builds x64 and arm64 together
A locally compiled cbor-extract module is included in a Linux packageThe application can fail with an illegal instruction on CPUs without the build machine's instruction setLinux packaging excludes the compiled build and lets cbor-x use a portable prebuilt module or JavaScript decoder

Key files

FileWhy to read it
package.jsonDefines the version, package targets, desktop identity, native dependencies, publish settings, Linux dependency exclusion, and build hook.
.github/…/build.ymlShows the platform build jobs, release versus pull request behavior, and packaged Linux smoke launch.
.github/…/release-please.ymlShows how a release proposal updates AppStream data, the lock file, and the changelog.
scripts/update-appdata-xml.jsShows how changelog entries become dated AppStream release notes.
scripts/generateReleaseInfo.jsShows the version and release-note contract used by Linux publishing.
scripts/afterpack.jsShows the final package preparation shared by platform builds.
app/…/index.jsShows the AppImage-only update check, user prompt, download, and restart flow.
.github/…/snap.ymlShows the Snap edge packaging path from main.
.github/…/snap-release.ymlShows the tagged-release Snap candidate path for x64 and arm64.
com.github.IsmaelMartinez.teams_for_linux.appdata.xmlProvides the release dates and notes consumed by Linux package metadata and publishing.