Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f7a50cf
Try gh_workflow generation
ConradIrwin Oct 24, 2025
f32fc2b
Try using gh_workflow to generate workflows
ConradIrwin Oct 25, 2025
a3647e4
Convert nix too
ConradIrwin Oct 25, 2025
3425fce
Fix
ConradIrwin Oct 25, 2025
2a08213
Fix env :/
ConradIrwin Oct 25, 2025
4f01f13
similar...
ConradIrwin Oct 25, 2025
7b885e3
Ugh, actually regenerate
ConradIrwin Oct 25, 2025
40201fe
Fix typos, move gh-workflow to zed
ConradIrwin Oct 27, 2025
de86ae2
More happier
ConradIrwin Oct 27, 2025
d24ab38
Start to port bundling
ConradIrwin Oct 27, 2025
2c01f31
Move run bundling out of CI
ConradIrwin Oct 27, 2025
9d65290
TEMP
ConradIrwin Oct 27, 2025
4fa3f1c
wip: windows
probably-neb Oct 27, 2025
6e9fedf
fix named::run
probably-neb Oct 27, 2025
8b38b6b
run xtask
probably-neb Oct 27, 2025
62a77f7
Merge branch 'main' into gh-workflow-bundling
ConradIrwin Oct 27, 2025
e117a21
UNclone
ConradIrwin Oct 27, 2025
4b65c5c
Don't upload symbols to DO anymore
ConradIrwin Oct 27, 2025
5063b26
oops
ConradIrwin Oct 27, 2025
6b90793
Fix bundling?
ConradIrwin Oct 27, 2025
02f733a
oops
ConradIrwin Oct 27, 2025
5a14437
Merge branch 'main' into gh-workflow-bundling
ConradIrwin Oct 28, 2025
22aa420
doto
ConradIrwin Oct 28, 2025
00ddb19
Tidy up naming some more
ConradIrwin Oct 28, 2025
01f468f
Fix naming more
ConradIrwin Oct 28, 2025
756d52e
oh yeah...
ConradIrwin Oct 28, 2025
0f7bab5
ugh names...
ConradIrwin Oct 28, 2025
5d023bf
Merge branch 'main' into gh-workflow-bundling
ConradIrwin Oct 28, 2025
c6b83df
Move windows arm64 over too
ConradIrwin Oct 28, 2025
8c5b4ea
Remove old conditions
ConradIrwin Oct 28, 2025
88f0bfa
Don't OOM?
ConradIrwin Oct 28, 2025
d07b99f
Release nightly?
ConradIrwin Oct 28, 2025
b40a27e
Merge remote-tracking branch 'origin/main' into gh-workflow-nightly
ConradIrwin Oct 28, 2025
22483a0
Restore name
ConradIrwin Oct 28, 2025
9c2321d
booleans
ConradIrwin Oct 28, 2025
c884575
Fix nightly?
ConradIrwin Oct 28, 2025
397daf9
foiled again
ConradIrwin Oct 28, 2025
028aef2
Make `bundle-mac` take an optional architecture argument
osiewicz Oct 28, 2025
5b021c9
Whoops
osiewicz Oct 28, 2025
6268bb0
This is bullying
osiewicz Oct 28, 2025
ee503c1
Merge remote-tracking branch 'origin/main' into notarize-in-parallel-v2
ConradIrwin Oct 28, 2025
c6f1ba7
Wait to build nix until tests pass
ConradIrwin Oct 28, 2025
cc960c7
Merge nightly changes
ConradIrwin Oct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create macOS app bundle
run: script/bundle-mac
- name: Create macOS app bundle (aarch64)
run: script/bundle-mac aarch64-apple-darwin

- name: Create macOS app bundle (x64)
run: script/bundle-mac x86_64-apple-darwin

- name: Rename binaries
run: |
Expand Down
57 changes: 50 additions & 7 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
shell: pwsh
timeout-minutes: 60
bundle_mac_nightly:
bundle_mac_nightly_x86_64:
needs:
- check_style
- run_tests_mac
Expand Down Expand Up @@ -131,11 +131,53 @@ jobs:
echo "Publishing version: ${version} on release channel nightly"
echo "nightly" > crates/zed/RELEASE_CHANNEL
shell: bash -euxo pipefail {0}
- name: ./script/bundle-mac
run: ./script/bundle-mac
- name: run_bundling::bundle_mac
run: ./script/bundle-mac x86_64-apple-darwin
shell: bash -euxo pipefail {0}
- name: release_nightly::upload_zed_nightly
run: script/upload-nightly macos
run: script/upload-nightly macos x86_64
shell: bash -euxo pipefail {0}
timeout-minutes: 60
bundle_mac_nightly_aarch64:
needs:
- check_style
- run_tests_mac
if: github.repository_owner == 'zed-industries'
runs-on: self-mini-macos
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
steps:
- name: steps::checkout_repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
clean: false
- name: steps::setup_node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '20'
- name: steps::setup_sentry
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
with:
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: steps::clear_target_dir_if_large
run: ./script/clear-target-dir-if-larger-than 300
shell: bash -euxo pipefail {0}
- name: release_nightly::set_release_channel_to_nightly
run: |
set -eu
version=$(git rev-parse --short HEAD)
echo "Publishing version: ${version} on release channel nightly"
echo "nightly" > crates/zed/RELEASE_CHANNEL
shell: bash -euxo pipefail {0}
- name: run_bundling::bundle_mac
run: ./script/bundle-mac aarch64-apple-darwin
shell: bash -euxo pipefail {0}
- name: release_nightly::upload_zed_nightly
run: script/upload-nightly macos aarch64
shell: bash -euxo pipefail {0}
timeout-minutes: 60
bundle_linux_nightly_x86_64:
Expand Down Expand Up @@ -176,7 +218,7 @@ jobs:
run: ./script/bundle-linux
shell: bash -euxo pipefail {0}
- name: release_nightly::upload_zed_nightly
run: script/upload-nightly linux-targz
run: script/upload-nightly linux-targz x86_64
shell: bash -euxo pipefail {0}
timeout-minutes: 60
bundle_linux_nightly_aarch64:
Expand Down Expand Up @@ -214,7 +256,7 @@ jobs:
run: ./script/bundle-linux
shell: bash -euxo pipefail {0}
- name: release_nightly::upload_zed_nightly
run: script/upload-nightly linux-targz
run: script/upload-nightly linux-targz aarch64
shell: bash -euxo pipefail {0}
timeout-minutes: 60
bundle_windows_nightly_x86_64:
Expand Down Expand Up @@ -372,7 +414,8 @@ jobs:
continue-on-error: true
update_nightly_tag:
needs:
- bundle_mac_nightly
- bundle_mac_nightly_x86_64
- bundle_mac_nightly_aarch64
- bundle_linux_nightly_x86_64
- bundle_linux_nightly_aarch64
- bundle_windows_nightly_x86_64
Expand Down
53 changes: 47 additions & 6 deletions .github/workflows/run_bundling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- labeled
- synchronize
jobs:
bundle_mac:
bundle_mac_x86_64:
if: |-
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
Expand All @@ -40,19 +40,60 @@ jobs:
- name: steps::clear_target_dir_if_large
run: ./script/clear-target-dir-if-larger-than 300
shell: bash -euxo pipefail {0}
- name: ./script/bundle-mac
run: ./script/bundle-mac
- name: run_bundling::bundle_mac
run: ./script/bundle-mac x86_64-apple-darwin
shell: bash -euxo pipefail {0}
- name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg'
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg
path: target/x86_64-apple-darwin/release/Zed.dmg
- name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-x86_64.gz'
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-x86_64.gz
path: target/zed-remote-server-macos-x86_64.gz
timeout-minutes: 60
bundle_mac_arm64:
if: |-
(github.event.action == 'labeled' && github.event.label.name == 'run-bundling') ||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'run-bundling'))
runs-on: self-mini-macos
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }}
APPLE_NOTARIZATION_KEY_ID: ${{ secrets.APPLE_NOTARIZATION_KEY_ID }}
APPLE_NOTARIZATION_ISSUER_ID: ${{ secrets.APPLE_NOTARIZATION_ISSUER_ID }}
steps:
- name: steps::checkout_repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
clean: false
- name: steps::setup_node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '20'
- name: steps::setup_sentry
uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b
with:
token: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: steps::clear_target_dir_if_large
run: ./script/clear-target-dir-if-larger-than 300
shell: bash -euxo pipefail {0}
- name: run_bundling::bundle_mac
run: ./script/bundle-mac aarch64-apple-darwin
shell: bash -euxo pipefail {0}
- name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.dmg'
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.dmg
path: target/aarch64-apple-darwin/release/Zed.dmg
- name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg'
- name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-aarch64.gz'
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4
with:
name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg
path: target/x86_64-apple-darwin/release/Zed.dmg
name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-aarch64.gz
path: target/zed-remote-server-macos-aarch64.gz
timeout-minutes: 60
bundle_linux_x86_64:
if: |-
Expand Down
119 changes: 35 additions & 84 deletions script/bundle-mac
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ open_result=false
local_arch=false
local_only=false
local_install=false
bundle_name=""
can_code_sign=false

# This must match the team in the provisioning profile.
Expand All @@ -19,12 +18,11 @@ APPLE_NOTARIZATION_TEAM="MQ55VZLNZQ"
# Function for displaying help info
help_info() {
echo "
Usage: ${0##*/} [options] [bundle_name]
Usage: ${0##*/} [options] [architecture=host]
Build the application bundle for macOS.

Options:
-d Compile in debug mode
-l Compile for local architecture only.
-o Open dir with the resulting DMG or launch the app itself in local mode.
-i Install the resulting DMG into /Applications in local mode. Noop without -l.
-h Display this help and exit.
Expand All @@ -41,12 +39,6 @@ do
build_flag="";
target_dir="debug"
;;
l)
export CARGO_INCREMENTAL=true
export CARGO_BUNDLE_SKIP_BUILD=true
local_arch=true
local_only=true
;;
i) local_install=true;;
h)
help_info
Expand All @@ -57,11 +49,6 @@ done

shift $((OPTIND-1))

if [[ $# -gt 0 ]]; then
if [ "$1" ]; then
bundle_name=$1
fi
fi

# Get release channel
pushd crates/zed
Expand All @@ -81,24 +68,31 @@ export CXXFLAGS="-stdlib=libc++"

version_info=$(rustc --version --verbose)
host_line=$(echo "$version_info" | grep host)
local_target_triple=${host_line#*: }
target_triple=${host_line#*: }
if [[ $# -gt 0 && -n "$1" ]]; then
target_triple="$1"
fi
remote_server_arch=""

if [[ "$target_triple" = "x86_64-apple-darwin" ]]; then
remote_server_arch="x86_64"
elif [[ "$target_triple" = "aarch64-apple-darwin" ]]; then
remote_server_arch="aarch64"
else
echo "Unsupported architecture $target_triple"
exit 1
fi

# Generate the licenses first, so they can be baked into the binaries
script/generate-licenses

if [ "$local_arch" = true ]; then
echo "Building for local target only."
cargo build ${build_flag} --package zed --package cli --package remote_server
else
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin

echo "Compiling zed binaries"
cargo build ${build_flag} --package zed --package cli --target aarch64-apple-darwin --target x86_64-apple-darwin
# Build remote_server in separate invocation to prevent feature unification from other crates
# from influencing dynamic libraries required by it.
cargo build ${build_flag} --package remote_server --target aarch64-apple-darwin --target x86_64-apple-darwin
fi
rustup target add $target_triple

echo "Compiling zed binaries"
cargo build ${build_flag} --package zed --package cli --target $target_triple
# Build remote_server in separate invocation to prevent feature unification from other crates
# from influencing dynamic libraries required by it.
cargo build ${build_flag} --package remote_server --target $target_triple

echo "Creating application bundle"
pushd crates/zed
Expand All @@ -108,13 +102,7 @@ sed \
"s/package.metadata.bundle-${channel}/package.metadata.bundle/" \
Cargo.toml

if [ "$local_arch" = true ]; then
app_path=$(cargo bundle ${build_flag} --select-workspace-root | xargs)
else
app_path_x64=$(cargo bundle ${build_flag} --target x86_64-apple-darwin --select-workspace-root | xargs)
app_path_aarch64=$(cargo bundle ${build_flag} --target aarch64-apple-darwin --select-workspace-root | xargs)
app_path=$app_path_x64
fi
app_path=$(cargo bundle ${build_flag} --target $target_triple --select-workspace-root | xargs)

mv Cargo.toml.backup Cargo.toml
popd
Expand Down Expand Up @@ -189,26 +177,12 @@ function download_git() {
rm -rf "$tmp_dir"
}

function prepare_binaries() {
local architecture=$1
local app_path=$2

cp target/${architecture}/${target_dir}/zed "${app_path}/Contents/MacOS/zed"
cp target/${architecture}/${target_dir}/cli "${app_path}/Contents/MacOS/cli"
}

function sign_app_binaries() {
local app_path=$1
local architecture=$2
local architecture_dir=$3
rm -rf "${app_path}/Contents/Frameworks"
mkdir -p "${app_path}/Contents/Frameworks"
if [ "$local_arch" = true ]; then
cp -R target/${target_dir}/cli "${app_path}/Contents/MacOS/"
fi

echo "Downloading git binary"
download_git "${architecture}" "${app_path}/Contents/MacOS/git"
download_git "${target_triple}" "${app_path}/Contents/MacOS/git"

# Note: The app identifier for our development builds is the same as the app identifier for nightly.
cp crates/zed/contents/$channel/embedded.provisionprofile "${app_path}/Contents/"
Expand Down Expand Up @@ -251,15 +225,7 @@ function sign_app_binaries() {
exit 0
fi

# If bundle_name is not set or empty, use the basename of $app_path
if [ -z "$bundle_name" ]; then
bundle_name=$(basename "$app_path")
else
# If bundle_name doesn't end in .app, append it
if [[ "$bundle_name" != *.app ]]; then
bundle_name="$bundle_name.app"
fi
fi
bundle_name=$(basename "$app_path")

if [ "$local_only" = true ]; then
if [ "$local_install" = true ]; then
Expand All @@ -277,7 +243,7 @@ function sign_app_binaries() {
fi
fi
else
dmg_target_directory="target/${architecture_dir}/${target_dir}"
dmg_target_directory="target/${target_triple}/${target_dir}"
dmg_source_directory="${dmg_target_directory}/dmg"
dmg_file_path="${dmg_target_directory}/Zed.dmg"
xcode_bin_dir_path="$(xcode-select -p)/usr/bin"
Expand Down Expand Up @@ -325,44 +291,29 @@ function sign_binary() {
/usr/bin/codesign --deep --force --timestamp --options runtime --entitlements crates/zed/resources/zed.entitlements --sign "$IDENTITY" "${binary_path}" -v
fi
}
cp target/${target_triple}/${target_dir}/zed "${app_path}/Contents/MacOS/zed"
cp target/${target_triple}/${target_dir}/cli "${app_path}/Contents/MacOS/cli"
sign_app_binaries

if [ "$local_arch" = true ]; then
sign_app_binaries "$app_path" "$local_target_triple" "$local_target_triple"

sign_binary "target/release/remote_server"
else
# Create universal binary
prepare_binaries "aarch64-apple-darwin" "$app_path_aarch64"
prepare_binaries "x86_64-apple-darwin" "$app_path_x64"


sign_app_binaries "$app_path_x64" "x86_64-apple-darwin" "x86_64-apple-darwin"
sign_app_binaries "$app_path_aarch64" "aarch64-apple-darwin" "aarch64-apple-darwin"

sign_binary "target/x86_64-apple-darwin/release/remote_server"
sign_binary "target/aarch64-apple-darwin/release/remote_server"
gzip -f --stdout --best target/x86_64-apple-darwin/release/remote_server > target/zed-remote-server-macos-x86_64.gz
gzip -f --stdout --best target/aarch64-apple-darwin/release/remote_server > target/zed-remote-server-macos-aarch64.gz
fi
sign_binary "target/$target_triple/release/remote_server"
gzip -f --stdout --best target/$target_triple/release/remote_server > target/zed-remote-server-macos-$remote_server_arch.gz

function upload_debug_info() {
architecture=$1
if [[ -n "${SENTRY_AUTH_TOKEN:-}" ]]; then
echo "Uploading zed debug symbols to sentry..."
# note: this uploads the unstripped binary which is needed because it contains
# .eh_frame data for stack unwinding. see https://github.com/getsentry/symbolic/issues/783
sentry-cli debug-files upload --include-sources --wait -p zed -o zed-dev \
"target/${architecture}/${target_dir}/zed" \
"target/${architecture}/${target_dir}/remote_server" \
"target/${architecture}/${target_dir}/zed.dwarf"
"target/${target_triple}/${target_dir}/zed" \
"target/${target_triple}/${target_dir}/remote_server" \
"target/${target_triple}/${target_dir}/zed.dwarf"
else
echo "missing SENTRY_AUTH_TOKEN. skipping sentry upload."
fi
}

if command -v sentry-cli >/dev/null 2>&1; then
upload_debug_info "aarch64-apple-darwin"
upload_debug_info "x86_64-apple-darwin"
upload_debug_info
else
echo "sentry-cli not found. skipping sentry upload."
echo "install with: 'curl -sL https://sentry.io/get-cli | bash'"
Expand Down
Loading
Loading