mirror of
https://github.com/zed-industries/zed.git
synced 2026-08-24 00:16:18 +00:00
99 lines
4.4 KiB
YAML
99 lines
4.4 KiB
YAML
# Generated from xtask::workflows::nix_build
|
|
# Rebuild with `cargo xtask workflows`.
|
|
name: nix_build
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: '1'
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- labeled
|
|
- synchronize
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
build_nix_linux_x86_64:
|
|
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && ((github.event.action == 'labeled' && (github.event.label.name == 'run-nix' || github.event.label.name == 'run-bundling')) || (github.event.action == 'synchronize' && (contains(github.event.pull_request.labels.*.name, 'run-nix') || contains(github.event.pull_request.labels.*.name, 'run-bundling'))))
|
|
runs-on: namespace-profile-32x64-ubuntu-2004
|
|
env:
|
|
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
|
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
|
ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
|
|
GIT_LFS_SKIP_SMUDGE: '1'
|
|
steps:
|
|
- name: steps::checkout_repo
|
|
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
|
with:
|
|
clean: false
|
|
- name: steps::cache_nix_dependencies_namespace
|
|
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
|
with:
|
|
cache: nix
|
|
- name: nix_build::build_nix::install_nix
|
|
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
|
|
with:
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: nix_build::build_nix::cachix_action
|
|
uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad
|
|
with:
|
|
name: zed
|
|
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
cachixArgs: -v
|
|
pushFilter: -zed-editor-[0-9.]*
|
|
- name: nix_build::build_nix::build
|
|
run: nix build .#default -L --accept-flake-config
|
|
timeout-minutes: 60
|
|
continue-on-error: true
|
|
build_nix_mac_aarch64:
|
|
if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && ((github.event.action == 'labeled' && (github.event.label.name == 'run-nix' || github.event.label.name == 'run-bundling')) || (github.event.action == 'synchronize' && (contains(github.event.pull_request.labels.*.name, 'run-nix') || contains(github.event.pull_request.labels.*.name, 'run-bundling'))))
|
|
runs-on: namespace-profile-mac-large
|
|
env:
|
|
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
|
|
ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }}
|
|
ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON: ${{ secrets.ZED_CLOUD_PROVIDER_ADDITIONAL_MODELS_JSON }}
|
|
GIT_LFS_SKIP_SMUDGE: '1'
|
|
steps:
|
|
- name: steps::checkout_repo
|
|
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
|
|
with:
|
|
clean: false
|
|
- name: steps::cache_nix_store_macos
|
|
uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
|
|
with:
|
|
path: ~/nix-cache
|
|
- name: nix_build::build_nix::install_nix
|
|
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
|
|
with:
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: nix_build::build_nix::configure_local_nix_cache
|
|
run: |
|
|
mkdir -p ~/nix-cache
|
|
echo "extra-substituters = file://$HOME/nix-cache?priority=10" | sudo tee -a /etc/nix/nix.conf
|
|
echo "require-sigs = false" | sudo tee -a /etc/nix/nix.conf
|
|
sudo launchctl kickstart -k system/org.nixos.nix-daemon
|
|
- name: nix_build::build_nix::cachix_action
|
|
uses: cachix/cachix-action@0fc020193b5a1fa3ac4575aa3a7d3aa6a35435ad
|
|
with:
|
|
name: zed
|
|
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
cachixArgs: -v
|
|
pushFilter: -zed-editor-[0-9.]*
|
|
- name: nix_build::build_nix::build
|
|
run: nix build .#default -L --accept-flake-config
|
|
- name: nix_build::build_nix::export_to_local_nix_cache
|
|
if: always()
|
|
run: |
|
|
if [ -L result ]; then
|
|
echo "Copying build closure to local binary cache..."
|
|
nix copy --to "file://$HOME/nix-cache" ./result || echo "Warning: nix copy to local cache failed"
|
|
else
|
|
echo "No build result found, skipping cache export."
|
|
fi
|
|
timeout-minutes: 60
|
|
continue-on-error: true
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
defaults:
|
|
run:
|
|
shell: bash -euxo pipefail {0}
|