Skip to content

Commit 13d1efa

Browse files
committed
Add internal release workflow for multi-platform builds
This commit introduces a new GitHub Actions workflow for internal releases, allowing for automated builds across macOS, Linux, and Windows platforms. The workflow is triggered by pushing tags matching the pattern `r*` or can be run manually. It includes steps for bundling applications for different architectures, setting release channels, and uploading artifacts. Key features: - Supports macOS aarch64 and x86_64 builds with code signing and notarization options. - Includes Linux x86_64 and aarch64 builds with system dependency installation. - Windows builds for both x86_64 and aarch64 architectures, with options to skip code-signing checks. Release Notes: - Added comprehensive internal release workflow for streamlined multi-platform builds.
1 parent 403a8a6 commit 13d1efa

1 file changed

Lines changed: 291 additions & 0 deletions

File tree

Lines changed: 291 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,291 @@
1+
# Internal Release workflow — independent of upstream release.yml / release_nightly.yml.
2+
#
3+
# Trigger:
4+
# - Push a tag matching `r*` (e.g. `git tag r0.1.0 && git push origin r0.1.0`)
5+
# - Or manually via Actions → Internal Release → Run workflow
6+
#
7+
# Secrets (all optional — builds still succeed without them):
8+
# MACOS_CERTIFICATE / MACOS_CERTIFICATE_PASSWORD — Apple code signing (.p12)
9+
# APPLE_NOTARIZATION_KEY / _KEY_ID / _ISSUER_ID — Apple notarization
10+
# ZED_CLIENT_CHECKSUM_SEED — checksum seed baked into binary
11+
#
12+
# Notes:
13+
# - Windows builds run with CI="" to skip Azure code-signing checks.
14+
# To enable signing, set the AZURE_* / ACCOUNT_NAME / CERT_PROFILE_NAME /
15+
# ENDPOINT / FILE_DIGEST / TIMESTAMP_* secrets and remove the `CI: ""` override.
16+
# - Linux aarch64 requires an ARM runner. GitHub offers `ubuntu-22.04-arm` for
17+
# Teams/Enterprise plans. If unavailable, remove or comment out the job.
18+
19+
name: Internal Release
20+
21+
on:
22+
push:
23+
tags:
24+
- "r*"
25+
workflow_dispatch:
26+
inputs:
27+
platforms:
28+
description: "Platforms to build (comma-separated: mac,linux,windows)"
29+
required: false
30+
default: "mac,linux,windows"
31+
32+
env:
33+
CARGO_TERM_COLOR: always
34+
RUST_BACKTRACE: "1"
35+
CARGO_INCREMENTAL: "0"
36+
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
37+
38+
defaults:
39+
run:
40+
shell: bash -euxo pipefail {0}
41+
42+
# ─── macOS ────────────────────────────────────────────────────
43+
jobs:
44+
bundle_mac_aarch64:
45+
if: github.event_name == 'push' || contains(github.event.inputs.platforms, 'mac')
46+
runs-on: macos-14
47+
timeout-minutes: 90
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Set release channel
52+
run: echo "nightly" > crates/zed/RELEASE_CHANNEL
53+
54+
- name: Bundle macOS aarch64
55+
run: ./script/bundle-mac aarch64-apple-darwin
56+
env:
57+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
58+
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
59+
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
60+
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
61+
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
62+
63+
- uses: actions/upload-artifact@v4
64+
with:
65+
name: Zed-aarch64.dmg
66+
path: target/aarch64-apple-darwin/release/Zed-aarch64.dmg
67+
if-no-files-found: error
68+
69+
- uses: actions/upload-artifact@v4
70+
with:
71+
name: zed-remote-server-macos-aarch64.gz
72+
path: target/zed-remote-server-macos-aarch64.gz
73+
if-no-files-found: warn
74+
75+
bundle_mac_x86_64:
76+
if: github.event_name == 'push' || contains(github.event.inputs.platforms, 'mac')
77+
runs-on: macos-13
78+
timeout-minutes: 90
79+
steps:
80+
- uses: actions/checkout@v4
81+
82+
- name: Set release channel
83+
run: echo "nightly" > crates/zed/RELEASE_CHANNEL
84+
85+
- name: Bundle macOS x86_64
86+
run: ./script/bundle-mac x86_64-apple-darwin
87+
env:
88+
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
89+
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
90+
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
91+
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
92+
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
93+
94+
- uses: actions/upload-artifact@v4
95+
with:
96+
name: Zed-x86_64.dmg
97+
path: target/x86_64-apple-darwin/release/Zed-x86_64.dmg
98+
if-no-files-found: error
99+
100+
- uses: actions/upload-artifact@v4
101+
with:
102+
name: zed-remote-server-macos-x86_64.gz
103+
path: target/zed-remote-server-macos-x86_64.gz
104+
if-no-files-found: warn
105+
106+
# ─── Linux ──────────────────────────────────────────────────
107+
bundle_linux_x86_64:
108+
if: github.event_name == 'push' || contains(github.event.inputs.platforms, 'linux')
109+
runs-on: ubuntu-22.04
110+
timeout-minutes: 90
111+
env:
112+
CC: clang
113+
CXX: clang++
114+
steps:
115+
- uses: actions/checkout@v4
116+
117+
- name: Set release channel
118+
run: echo "nightly" > crates/zed/RELEASE_CHANNEL
119+
120+
- name: Install system dependencies
121+
run: ./script/linux
122+
123+
- name: Download WASI SDK
124+
run: ./script/download-wasi-sdk
125+
126+
- name: Bundle Linux x86_64
127+
run: ./script/bundle-linux
128+
129+
- uses: actions/upload-artifact@v4
130+
with:
131+
name: zed-linux-x86_64.tar.gz
132+
path: target/release/zed-linux-x86_64.tar.gz
133+
if-no-files-found: error
134+
135+
- uses: actions/upload-artifact@v4
136+
with:
137+
name: zed-remote-server-linux-x86_64.gz
138+
path: target/zed-remote-server-linux-x86_64.gz
139+
if-no-files-found: warn
140+
141+
# Requires ARM runner — GitHub Teams/Enterprise plan, or self-hosted.
142+
# Comment out this job if ARM runners are unavailable.
143+
bundle_linux_aarch64:
144+
if: github.event_name == 'push' || contains(github.event.inputs.platforms, 'linux')
145+
runs-on: ubuntu-22.04-arm
146+
timeout-minutes: 90
147+
env:
148+
CC: clang
149+
CXX: clang++
150+
steps:
151+
- uses: actions/checkout@v4
152+
153+
- name: Set release channel
154+
run: echo "nightly" > crates/zed/RELEASE_CHANNEL
155+
156+
- name: Install system dependencies
157+
run: ./script/linux
158+
159+
- name: Download WASI SDK
160+
run: ./script/download-wasi-sdk
161+
162+
- name: Bundle Linux aarch64
163+
run: ./script/bundle-linux
164+
165+
- uses: actions/upload-artifact@v4
166+
with:
167+
name: zed-linux-aarch64.tar.gz
168+
path: target/release/zed-linux-aarch64.tar.gz
169+
if-no-files-found: error
170+
171+
- uses: actions/upload-artifact@v4
172+
with:
173+
name: zed-remote-server-linux-aarch64.gz
174+
path: target/zed-remote-server-linux-aarch64.gz
175+
if-no-files-found: warn
176+
177+
# ─── Windows ────────────────────────────────────────────────
178+
bundle_windows_x86_64:
179+
if: github.event_name == 'push' || contains(github.event.inputs.platforms, 'windows')
180+
runs-on: windows-2022
181+
timeout-minutes: 90
182+
env:
183+
CI: ""
184+
steps:
185+
- uses: actions/checkout@v4
186+
187+
- name: Set release channel
188+
run: |
189+
$ErrorActionPreference = "Stop"
190+
"nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL" -NoNewline
191+
shell: pwsh
192+
193+
- name: Bundle Windows x86_64
194+
run: script/bundle-windows.ps1 -Architecture x86_64
195+
shell: pwsh
196+
197+
- uses: actions/upload-artifact@v4
198+
with:
199+
name: Zed-x86_64.exe
200+
path: target/Zed-x86_64.exe
201+
if-no-files-found: error
202+
203+
- uses: actions/upload-artifact@v4
204+
with:
205+
name: zed-remote-server-windows-x86_64.zip
206+
path: target/zed-remote-server-windows-x86_64.zip
207+
if-no-files-found: warn
208+
209+
bundle_windows_aarch64:
210+
if: github.event_name == 'push' || contains(github.event.inputs.platforms, 'windows')
211+
runs-on: windows-2022
212+
timeout-minutes: 90
213+
env:
214+
CI: ""
215+
steps:
216+
- uses: actions/checkout@v4
217+
218+
- name: Set release channel
219+
run: |
220+
$ErrorActionPreference = "Stop"
221+
"nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL" -NoNewline
222+
shell: pwsh
223+
224+
- name: Bundle Windows aarch64
225+
run: script/bundle-windows.ps1 -Architecture aarch64
226+
shell: pwsh
227+
228+
- uses: actions/upload-artifact@v4
229+
with:
230+
name: Zed-aarch64.exe
231+
path: target/Zed-aarch64.exe
232+
if-no-files-found: error
233+
234+
- uses: actions/upload-artifact@v4
235+
with:
236+
name: zed-remote-server-windows-aarch64.zip
237+
path: target/zed-remote-server-windows-aarch64.zip
238+
if-no-files-found: warn
239+
240+
# ─── GitHub Release ─────────────────────────────────────────
241+
create_release:
242+
needs:
243+
- bundle_mac_aarch64
244+
- bundle_mac_x86_64
245+
- bundle_linux_x86_64
246+
- bundle_linux_aarch64
247+
- bundle_windows_x86_64
248+
- bundle_windows_aarch64
249+
if: always() && !cancelled() && startsWith(github.ref, 'refs/tags/')
250+
runs-on: ubuntu-latest
251+
permissions:
252+
contents: write
253+
steps:
254+
- uses: actions/download-artifact@v4
255+
with:
256+
path: ./artifacts/
257+
258+
- name: Collect release artifacts
259+
run: |
260+
mkdir -p release/
261+
for dir in ./artifacts/*/; do
262+
for file in "$dir"*; do
263+
[ -f "$file" ] && cp "$file" release/
264+
done
265+
done
266+
echo "=== Release artifacts ==="
267+
ls -lh release/
268+
269+
- name: Create draft GitHub Release
270+
run: |
271+
TAG="${GITHUB_REF_NAME}"
272+
gh release create "$TAG" \
273+
--repo "$GITHUB_REPOSITORY" \
274+
--title "Internal Release ${TAG}" \
275+
--notes "$(cat <<'EOF'
276+
Build from ${{ github.sha }}
277+
278+
| Platform | Client | Remote Server |
279+
|----------|--------|---------------|
280+
| macOS Apple Silicon | Zed-aarch64.dmg | zed-remote-server-macos-aarch64.gz |
281+
| macOS Intel | Zed-x86_64.dmg | zed-remote-server-macos-x86_64.gz |
282+
| Linux x86_64 | zed-linux-x86_64.tar.gz | zed-remote-server-linux-x86_64.gz |
283+
| Linux aarch64 | zed-linux-aarch64.tar.gz | zed-remote-server-linux-aarch64.gz |
284+
| Windows x86_64 | Zed-x86_64.exe | zed-remote-server-windows-x86_64.zip |
285+
| Windows aarch64 | Zed-aarch64.exe | zed-remote-server-windows-aarch64.zip |
286+
EOF
287+
)" \
288+
--draft \
289+
release/* 2>/dev/null || true
290+
env:
291+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)