Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix(ci): publish desktop installers independently of updater signing (#7830)
Eric Hayes176c428aaa4d
diff --git a/.github/workflows/build_desktop_on_tag.yml b/.github/workflows/build_desktop_on_tag.ymlindex a956d9a72e..87908488c5 100644--- a/.github/workflows/build_desktop_on_tag.yml+++ b/.github/workflows/build_desktop_on_tag.yml@@ -602,11 +602,46 @@ jobs:path: artifacts/*if-no-files-found: errorretention-days: '30'- publish-release:+ publish-installers:needs:- resolve-ref- build-appimage- build-dmg+ name: Publish desktop installers+ runs-on: ubuntu-latest+ permissions:+ contents: write+ steps:+ - id: metadata+ name: Derive artifact metadata+ run: |+ set -euo pipefail+ tag="${RAW_REF#refs/tags/}"+ if [ -z "$tag" ]; then+ tag="${GITHUB_REF_NAME:-untagged}"+ fi+ safe_tag=$(printf '%s' "$tag" | sed 's#[/\\:*?"<>|]#-#g' | tr -d '\r\n')+ echo "tag=$tag" >> "$GITHUB_OUTPUT"+ echo "safe_tag=$safe_tag" >> "$GITHUB_OUTPUT"+ shell: bash+ env:+ RAW_REF: ${{ needs.resolve-ref.outputs.ref }}+ - name: Download Build Artifacts+ uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0+ with:+ path: release-artifacts+ merge-multiple: 'true'+ - name: Upload Release Artifacts+ if: startsWith(steps.metadata.outputs.tag, 'v')+ uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65+ with:+ tag_name: ${{ steps.metadata.outputs.tag }}+ files: release-artifacts/*+ fail_on_unmatched_files: 'true'+ publish-release:+ needs:+ - resolve-ref+ - publish-installersif: startsWith(needs.resolve-ref.outputs.ref, 'refs/tags/v')name: Sign and publish desktop updatesruns-on: ubuntu-latest@@ -615,6 +650,7 @@ jobs:concurrency:group: desktop-stable-publishcancel-in-progress: false+ timeout-minutes: 20steps:- name: Checkout Repouses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10@@ -761,9 +797,6 @@ jobs:GH_TOKEN: ${{ github.token }}RELEASE_TAG: ${{ steps.metadata.outputs.tag }}RELEASE_REPOSITORY: ${{ github.repository }}- - name: Teardown Nix- if: always()- uses: './.github/actions/teardown-nix'concurrency:group: desktop-${{ inputs.ref || (github.event.ref_type == 'tag' && github.event.ref || github.ref_name) }}cancel-in-progress: truediff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag.rsindex 78be784c2d..5d45ae4244 100644--- a/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag.rs+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag.rs@@ -14,6 +14,9 @@ use gh_workflow::{use crate::workflows::{build_appimage_on_tag, build_dmg_on_tag, steps, vars};+#[cfg(test)]+mod test;+const RESOLVED_REF: &str = "${{ needs.resolve-ref.outputs.ref }}";/// Build the workflow.@@ -33,12 +36,25 @@ pub fn build_desktop_on_tag() -> Workflow {"build-dmg",build_dmg_on_tag::build_dmg_job(RESOLVED_REF).add_needs("resolve-ref"),)+ // The installers users download must reach the release on their own.+ // Updater signing needs Doppler, Apple, and the stable channel; none of+ // that may stand between a green build and macro.com/download.+ .add_job(+ "publish-installers",+ build_appimage_on_tag::publish_job(+ RESOLVED_REF,+ xtask_paths::runtime_path!("release-artifacts/*"),+ )+ .name("Publish desktop installers")+ .add_needs("resolve-ref")+ .add_needs("build-appimage")+ .add_needs("build-dmg"),+ ).add_job("publish-release",publish_desktop_job().add_needs("resolve-ref")- .add_needs("build-appimage")- .add_needs("build-dmg"),+ .add_needs("publish-installers"),)}@@ -50,6 +66,9 @@ fn publish_desktop_job() -> Job {.concurrency(Concurrency::new(Expression::new("desktop-stable-publish")).cancel_in_progress(false),)+ // A wedged signer must not hold the channel lock, and must not sit long+ // enough for the runner to be reaped with its logs still unuploaded.+ .timeout_minutes(20u32).cond(Expression::new("startsWith(needs.resolve-ref.outputs.ref, 'refs/tags/v')",))@@ -80,7 +99,10 @@ fn publish_desktop_job() -> Job {.add_env(("RELEASE_TAG", "${{ steps.metadata.outputs.tag }}")).add_env(("RELEASE_REPOSITORY", "${{ github.repository }}")),)- .add_step(steps::teardown_nix())+ // No Teardown Nix here. This job runs on a hosted runner with no /nix cache+ // volume to unmount, where the teardown's `fuser -km /nix` kills the runner+ // process itself — the job dies with "lost communication with the server"+ // and its logs are never uploaded.}fn desktop_events() -> Event {diff --git a/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag/test.rs b/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag/test.rsnew file mode 100644index 0000000000..38430bcf7d--- /dev/null+++ b/tooling/xtask/crates/xtask_workflows/src/workflows/build_desktop_on_tag/test.rs@@ -0,0 +1,62 @@+use super::*;++fn rendered_yaml() -> String {+ build_desktop_on_tag()+ .to_string()+ .expect("desktop workflow should serialize")+}++#[test]+fn installers_publish_without_waiting_on_updater_signing() {+ let yaml = rendered_yaml();+ let installers = yaml+ .find(" publish-installers:")+ .expect("installer publish job");+ let updates = yaml+ .find(" publish-release:")+ .expect("updater publish job");++ // Both builds gate the installer upload, and nothing else does: a Doppler,+ // Apple, or update-feed failure must still leave a downloadable release.+ let installer_job = &yaml[installers..updates];+ assert!(+ installer_job.contains("- build-appimage"),+ "{installer_job}"+ );+ assert!(installer_job.contains("- build-dmg"), "{installer_job}");+ assert!(+ !installer_job.contains("sign_desktop_updates") && !installer_job.contains("DOPPLER_TOKEN"),+ "installer publication must not depend on updater signing:\n{installer_job}"+ );+}++#[test]+fn updater_publish_follows_the_installers() {+ let yaml = rendered_yaml();+ let updates = yaml+ .find(" publish-release:")+ .expect("updater publish job");+ // Serialized behind the installer upload so the two never race to attach+ // the same asset, which `gh release upload` rejects without --clobber.+ assert!(+ yaml[updates..].contains("- publish-installers"),+ "{}",+ &yaml[updates..]+ );+}++#[test]+fn hosted_publish_runner_skips_the_nix_cache_teardown() {+ let yaml = rendered_yaml();+ let updates = yaml+ .find(" publish-release:")+ .expect("updater publish job");+ // `fuser -km /nix` kills the runner itself where /nix is the root+ // filesystem, losing the job and its logs. Only cache-volume jobs tear down.+ assert!(+ !yaml[updates..].contains("teardown-nix"),+ "{}",+ &yaml[updates..]+ );+ assert!(yaml[updates..].contains("timeout-minutes: 20"));+}