Skip to content

Commit

The desktop release's Windows job brings its own Rust when the runner's account has none, so a runner installed as a Windows service builds it without anyone touching the machine; and the runner release builds Linux and Windows only for now, since zig cannot link the macOS targets without Apple's SDK.

syntaqxcommitted Parent74d6910Browse files
2 files+17−20/2 viewed
+10−0
109109 timeout-minutes: 90
110110 steps:
111111 - uses: actions/checkout@v5
112+ # A runner that is a Windows service runs as the system account, whose
113+ # PATH and profile hold no Rust even when the machine's user has one;
114+ # the job brings its own, once, into that account's profile.
115+ - name: Rust, if this account lacks it
116+ run: |
117+ if (-not (Get-Command cargo -ErrorAction SilentlyContinue) -and -not (Test-Path "$env:USERPROFILE\.cargo\bin\cargo.exe")) {
118+ Invoke-WebRequest https://win.rustup.rs/x86_64 -OutFile "$env:TEMP\rustup-init.exe" -UseBasicParsing
119+ & "$env:TEMP\rustup-init.exe" -y --profile minimal --default-toolchain stable | Out-Null
120+ }
121+ "$env:USERPROFILE\.cargo\bin" | Out-File -Append -Encoding utf8 $env:GITHUB_PATH
112122 - name: Install
113123 run: npm ci --no-audit --no-fund
114124 - name: Build and sign
+7−2
5050 ~/.cargo/registry
5151 target
5252 key: runner-release-${{ hashFiles('Cargo.lock') }}
53− - name: Build every platform
53+ - name: Build Linux and Windows
54+ # The macOS targets need Apple's SDK to link (the Security and
55+ # CoreFoundation frameworks), which zig does not carry, so they are
56+ # left out until this builds in the rust-cross/cargo-zigbuild image
57+ # as the CLI's release does (scripts/cli-release.mjs). A Mac runner
58+ # keeps the version it has, since the manifest names no file for it.
5459 env:
5560 G1T_RUNNER_RELEASE_KEY: ${{ vars.RUNNER_RELEASE_PUBLIC_KEY }}
5661 RUNNER_AGENT_IMAGE: ${{ vars.RUNNER_AGENT_IMAGE }}
57− run: node scripts/runner-release.mjs build
62+ run: node scripts/runner-release.mjs build --targets linux-x64,linux-arm64,windows-x64
5863 - name: Sign
5964 env:
6065 RUNNER_RELEASE_KEY: ${{ secrets.RUNNER_RELEASE_KEY }}