# Builds per README "Quick start": `cargo build -p app`, plus the universal macOS # binary from scripts/build-macos.sh and the Linux packages from # packaging/linux/package.sh. Tests live in test.yml; this file only packages the # artifacts. name: Build # Builds run for tags (the release assets); pushes are tested in test.yml. # A `v*` tag also publishes a GitHub release; a tag with `-` (v0.2.0-rc.1) is a pre-release. on: push: tags: ['*'] workflow_dispatch: permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: CARGO_TERM_COLOR: always jobs: linux: name: Linux # The oldest supported Ubuntu LTS: the binary needs the glibc it was built # against, so building here lets it, the AppImage and the deb/rpm run on # glibc 2.35 and newer. runs-on: ubuntu-22.04 timeout-minutes: 90 # webrtc-sys compiles its C++ against the hermetic libc++ inside the libwebrtc # artifact, which needs a clang as new as that libc++ (clang 21 today, see # check_clang_version in vendor/webrtc-sys/build.rs). The distro clang is older # (18 on ubuntu-24.04), so setup-linux installs clang 21 and these point every # compile and the final link at it. env: CC: clang-21 CXX: clang++-21 CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang-21 steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup-linux - uses: dtolnay/rust-toolchain@stable # Its own key: build scripts cached on a newer Ubuntu would need a newer glibc. - uses: Swatinem/rust-cache@v2 with: key: build-ubuntu-22.04 - name: Build run: cargo build -p app --release # Before packaging. A later Flatpak or package failure must not drop the binary. - uses: actions/upload-artifact@v7 with: name: teams-linux-amd64 path: target/release/teams if-no-files-found: error # nfpm builds the deb and rpm, zsync the AppImage's .zsync; desktop-file-utils # and appstream validate the metadata. AppImage tooling is downloaded by # package.sh at pinned digests. - name: Install packaging tools env: NFPM_VERSION: 2.48.0 NFPM_SHA256: 787af76e172dd5fc7cedf4d7c5a090a2f62be9001557a4db1103e270f90ddefd run: | sudo apt-get install --no-install-recommends -y zsync desktop-file-utils appstream curl -fsSL -o "$RUNNER_TEMP/nfpm.deb" \ "https://github.com/goreleaser/nfpm/releases/download/v$NFPM_VERSION/nfpm_${NFPM_VERSION}_amd64.deb" echo "$NFPM_SHA256 $RUNNER_TEMP/nfpm.deb" | sha256sum -c - sudo dpkg -i "$RUNNER_TEMP/nfpm.deb" # A tag build carries the tag's version (v0.5.0-rc.1 -> 0.5.0~rc.1 in the deb). - name: Package env: RUSTY_TEAMS_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '' }} run: packaging/linux/package.sh --skip-build --formats "appimage deb rpm" # deb, rpm, AppImage and its .zsync. Uploaded before Arch and Flatpak, so a # later failure leaves these artifacts in the run. - uses: actions/upload-artifact@v7 with: name: teams-linux-packages path: dist/release/* if-no-files-found: error # Arch is its own artifact. A failure here does not drop deb/rpm/AppImage, # and Flatpak still runs. The job goes red at the end if either is missing. - name: Arch id: arch continue-on-error: true env: RUSTY_TEAMS_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '' }} run: packaging/linux/package.sh --skip-build --formats archlinux - uses: actions/upload-artifact@v7 if: steps.arch.outcome == 'success' with: name: teams-linux-arch path: dist/release/*.pkg.tar.zst if-no-files-found: error # The Flatpak repackages a tarball built only for it; the release keeps its own tarball. - name: Flatpak id: flatpak continue-on-error: true env: RUSTY_TEAMS_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '' }} run: | # 22.04's flatpak-builder 1.2 still calls appstream-compose, which the 26.08 SDK dropped. sudo add-apt-repository -y ppa:flatpak/stable sudo apt-get install --no-install-recommends -y flatpak flatpak-builder DIST="$RUNNER_TEMP/flatpak" packaging/linux/package.sh --skip-build --formats tar packaging/linux/flatpak-bundle.sh --no-test "$RUNNER_TEMP"/flatpak/rusty-teams-*-linux-x86_64.tar.gz - uses: actions/upload-artifact@v7 if: steps.flatpak.outcome == 'success' with: name: teams-linux-flatpak path: dist/release/*.flatpak if-no-files-found: error - name: Require Arch and Flatpak if: steps.arch.outcome != 'success' || steps.flatpak.outcome != 'success' run: | echo "arch=${{ steps.arch.outcome }} flatpak=${{ steps.flatpak.outcome }}" exit 1 windows: name: Windows runs-on: windows-latest timeout-minutes: 90 defaults: run: shell: bash steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: key: build # After the toolchain: staging runs `cargo metadata`. - uses: ./.github/actions/setup-windows # fxc.exe comes from the Windows SDK, gpui-pre-windows finds it through the registry. - name: Build run: cargo build -p app --release --config "patch.crates-io.gpui-pre-windows.path=\"$GPUI_PRE_WINDOWS_PATCHED\"" # The runner is x86_64; the artifact name carries the architecture. - uses: actions/upload-artifact@v7 with: name: teams-windows-amd64 path: target/release/teams.exe windows-arm: name: Windows ARM64 runs-on: windows-11-arm timeout-minutes: 90 defaults: run: shell: bash steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: key: build-windows-arm # After the toolchain: staging runs `cargo metadata` for aarch64. - uses: ./.github/actions/setup-windows - name: Build run: cargo build -p app --release --config "patch.crates-io.gpui-pre-windows.path=\"$GPUI_PRE_WINDOWS_PATCHED\"" - uses: actions/upload-artifact@v7 with: name: teams-windows-arm64 path: target/release/teams.exe macos: name: macOS runs-on: macos-latest timeout-minutes: 90 steps: - uses: actions/checkout@v6 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: key: build # scripts/build-macos.sh builds the arm64 and x86_64 slices, lipos them into # one universal binary and wraps it in a .app with the icon (README "Quick # start"); it installs the x86_64 rustup target itself and needs Xcode CLT only. - name: Build run: scripts/build-macos.sh crates/app teams - uses: actions/upload-artifact@v7 with: name: teams-macos path: target/universal/release/teams-macos.zip release: name: Release needs: [linux, windows, windows-arm, macos] # A failed platform must not hide the artifacts the other jobs already uploaded. # The job stays red afterwards when an expected asset is missing. if: always() && !cancelled() && startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/download-artifact@v8 with: path: dist # Artifacts drop the executable bit, the tarball restores it. # Asset names use the version without the leading v (rusty-teams-0.5.0-…). - name: Package id: package env: TAG: ${{ github.ref_name }} run: | set -euo pipefail ver="${TAG#v}" mkdir release missing=() take() { local src="$1" dest="$2" label="$3" if [[ -f "$src" ]]; then cp "$src" "$dest" else echo "missing $label" >&2 missing+=("$label") fi } if [[ -f dist/teams-linux-amd64/teams ]]; then chmod +x dist/teams-linux-amd64/teams tar -czf "release/rusty-teams-$ver-linux-amd64.tar.gz" -C dist/teams-linux-amd64 teams # The bare binary is what the Linux self-update downloads (release_feed.rs). cp dist/teams-linux-amd64/teams "release/rusty-teams-$ver-linux-amd64" else missing+=("linux-amd64") fi take dist/teams-windows-amd64/teams.exe "release/rusty-teams-$ver-windows-amd64.exe" "windows-amd64" take dist/teams-windows-arm64/teams.exe "release/rusty-teams-$ver-windows-arm64.exe" "windows-arm64" take dist/teams-macos/teams-macos.zip "release/rusty-teams-$ver-macos-universal.zip" "macos" shopt -s nullglob packages=(dist/teams-linux-packages/*) if (( ${#packages[@]} )); then # deb, rpm, AppImage and its .zsync. The AppImage update information looks for that .zsync name. cp "${packages[@]}" release/ else missing+=("linux-packages") fi flatpaks=(dist/teams-linux-flatpak/*.flatpak) if (( ${#flatpaks[@]} )); then cp "${flatpaks[@]}" release/ else missing+=("flatpak") fi archpkgs=(dist/teams-linux-arch/*.pkg.tar.zst) if (( ${#archpkgs[@]} )); then cp "${archpkgs[@]}" release/ else missing+=("arch") fi assets=(release/*) if (( ${#assets[@]} )); then echo "publish=true" >> "$GITHUB_OUTPUT" else echo "publish=false" >> "$GITHUB_OUTPUT" fi if (( ${#missing[@]} )); then echo "complete=false" >> "$GITHUB_OUTPUT" echo "missing=${missing[*]}" >> "$GITHUB_OUTPUT" else echo "complete=true" >> "$GITHUB_OUTPUT" echo "missing=" >> "$GITHUB_OUTPUT" fi - uses: softprops/action-gh-release@v3 if: steps.package.outputs.publish == 'true' with: files: release/* generate_release_notes: true prerelease: ${{ contains(github.ref_name, '-') }} - name: Fail when an asset is missing if: always() && !cancelled() && steps.package.outputs.complete != 'true' run: | echo "Published the assets that were built. Still missing: ${{ steps.package.outputs.missing }}" exit 1