From 023a1bdaacd381c56a1263d4202f1ec1365835d5 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Fri, 31 Oct 2025 23:40:24 -0600 Subject: [PATCH] Re-use the existing bundle steps for nightly too --- .github/workflows/release.yml | 57 ++- .github/workflows/release_nightly.yml | 375 ++++++++++-------- .github/workflows/run_bundling.yml | 205 +++++----- .github/workflows/run_tests.yml | 1 - script/upload-nightly | 67 +--- tooling/xtask/src/tasks/workflows/release.rs | 206 +++++----- .../src/tasks/workflows/release_nightly.rs | 181 +++------ .../xtask/src/tasks/workflows/run_bundling.rs | 252 +++++++----- .../xtask/src/tasks/workflows/run_tests.rs | 16 +- tooling/xtask/src/tasks/workflows/runners.rs | 13 +- tooling/xtask/src/tasks/workflows/vars.rs | 45 ++- 11 files changed, 706 insertions(+), 712 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56ea875d5cefec240d554984a8c0e1c1992a574c..2ff7fb400be95372b2cb3bfef87f5dee731e2bf4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,10 +3,7 @@ name: release env: CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: '0' RUST_BACKTRACE: '1' - ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} - ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} on: push: tags: @@ -177,11 +174,15 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} timeout-minutes: 60 - bundle_linux_arm64: + bundle_linux_aarch64: needs: - run_tests_linux - check_scripts runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4 + env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} steps: - name: steps::checkout_repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 @@ -221,6 +222,10 @@ jobs: - run_tests_linux - check_scripts runs-on: namespace-profile-32x64-ubuntu-2004 + env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} steps: - name: steps::checkout_repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 @@ -255,12 +260,15 @@ jobs: zed: zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz timeout-minutes: 60 - bundle_mac_arm64: + bundle_mac_aarch64: needs: - run_tests_mac - check_scripts runs-on: self-mini-macos env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }} @@ -282,7 +290,7 @@ jobs: - 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 + - name: run_bundling::bundle_mac::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' @@ -307,6 +315,9 @@ jobs: - check_scripts runs-on: self-mini-macos env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }} @@ -328,7 +339,7 @@ jobs: - 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 + - name: run_bundling::bundle_mac::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' @@ -347,12 +358,15 @@ jobs: zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-x86_64.gz timeout-minutes: 60 - bundle_windows_arm64: + bundle_windows_aarch64: needs: - run_tests_windows - check_scripts runs-on: self-32vcpu-windows-2022 env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }} AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }} @@ -371,7 +385,7 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: run_bundling::bundle_windows + - name: run_bundling::bundle_windows::bundle_windows run: script/bundle-windows.ps1 -Architecture aarch64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} @@ -390,6 +404,9 @@ jobs: - check_scripts runs-on: self-32vcpu-windows-2022 env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }} AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }} @@ -408,7 +425,7 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: run_bundling::bundle_windows + - name: run_bundling::bundle_windows::bundle_windows run: script/bundle-windows.ps1 -Architecture x86_64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} @@ -424,35 +441,35 @@ jobs: upload_release_assets: needs: - create_draft_release - - bundle_linux_arm64 + - bundle_linux_aarch64 - bundle_linux_x86_64 - - bundle_mac_arm64 + - bundle_mac_aarch64 - bundle_mac_x86_64 - - bundle_windows_arm64 + - bundle_windows_aarch64 - bundle_windows_x86_64 runs-on: namespace-profile-4x8-ubuntu-2204 steps: - - name: release::upload_release_assets::download_workflow_artifacts + - name: release::download_workflow_artifacts uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 with: path: ./artifacts/ - name: ls -lR ./artifacts run: ls -lR ./artifacts shell: bash -euxo pipefail {0} - - name: release::upload_release_assets::prep_release_artifacts + - name: release::prep_release_artifacts run: |- mkdir -p release-artifacts/ mv ./artifacts/${{ needs.bundle_mac_x86_64.outputs.zed }}/* release-artifacts/Zed-x86_64.dmg - mv ./artifacts/${{ needs.bundle_mac_arm64.outputs.zed }}/* release-artifacts/Zed-aarch64.dmg + mv ./artifacts/${{ needs.bundle_mac_aarch64.outputs.zed }}/* release-artifacts/Zed-aarch64.dmg mv ./artifacts/${{ needs.bundle_windows_x86_64.outputs.zed }}/* release-artifacts/Zed-x86_64.exe - mv ./artifacts/${{ needs.bundle_windows_arm64.outputs.zed }}/* release-artifacts/Zed-aarch64.exe - mv ./artifacts/${{ needs.bundle_linux_arm64.outputs.zed }}/* release-artifacts/zed-linux-aarch64.tar.gz + mv ./artifacts/${{ needs.bundle_windows_aarch64.outputs.zed }}/* release-artifacts/Zed-aarch64.exe + mv ./artifacts/${{ needs.bundle_linux_aarch64.outputs.zed }}/* release-artifacts/zed-linux-aarch64.tar.gz mv ./artifacts/${{ needs.bundle_linux_x86_64.outputs.zed }}/* release-artifacts/zed-linux-x86_64.tar.gz mv ./artifacts/${{ needs.bundle_linux_x86_64.outputs.remote-server }}/* release-artifacts/zed-remote-server-linux-x86_64.gz - mv ./artifacts/${{ needs.bundle_linux_arm64.outputs.remote-server }}/* release-artifacts/zed-remote-server-linux-aarch64.gz + mv ./artifacts/${{ needs.bundle_linux_aarch64.outputs.remote-server }}/* release-artifacts/zed-remote-server-linux-aarch64.gz mv ./artifacts/${{ needs.bundle_mac_x86_64.outputs.remote-server }}/* release-artifacts/zed-remote-server-macos-x86_64.gz - mv ./artifacts/${{ needs.bundle_mac_arm64.outputs.remote-server }}/* release-artifacts/zed-remote-server-macos-aarch64.gz + mv ./artifacts/${{ needs.bundle_mac_aarch64.outputs.remote-server }}/* release-artifacts/zed-remote-server-macos-aarch64.gz shell: bash -euxo pipefail {0} - name: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/* run: gh release upload "$GITHUB_REF_NAME" --repo=zed-industries/zed release-artifacts/* diff --git a/.github/workflows/release_nightly.yml b/.github/workflows/release_nightly.yml index 20230fb499ea9fa892a316bd1762424869004262..278793c7ea8a2a6fc38e92a1eb32b37f113d07db 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -3,12 +3,7 @@ name: release_nightly env: CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: '0' RUST_BACKTRACE: '1' - ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} - ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} - DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }} - DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }} on: push: tags: @@ -32,41 +27,6 @@ jobs: run: ./script/clippy shell: bash -euxo pipefail {0} timeout-minutes: 60 - run_tests_mac: - if: github.repository_owner == 'zed-industries' - runs-on: self-mini-macos - steps: - - name: steps::checkout_repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - with: - clean: false - - name: steps::setup_cargo_config - run: | - mkdir -p ./../.cargo - cp ./.cargo/ci-config.toml ./../.cargo/config.toml - shell: bash -euxo pipefail {0} - - name: steps::setup_node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 - with: - node-version: '20' - - name: steps::clippy - run: ./script/clippy - shell: bash -euxo pipefail {0} - - name: steps::cargo_install_nextest - run: cargo install cargo-nextest --locked - shell: bash -euxo pipefail {0} - - name: steps::clear_target_dir_if_large - run: ./script/clear-target-dir-if-larger-than 300 - shell: bash -euxo pipefail {0} - - name: steps::cargo_nextest - run: cargo nextest run --workspace --no-fail-fast --failure-output immediate-final - shell: bash -euxo pipefail {0} - - name: steps::cleanup_cargo_config - if: always() - run: | - rm -rf ./../.cargo - shell: bash -euxo pipefail {0} - timeout-minutes: 60 run_tests_windows: if: github.repository_owner == 'zed-industries' runs-on: self-32vcpu-windows-2022 @@ -102,55 +62,115 @@ jobs: Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue shell: pwsh timeout-minutes: 60 - bundle_mac_nightly_x86_64: + bundle_linux_aarch64: needs: - check_style - - run_tests_mac - if: github.repository_owner == 'zed-industries' - runs-on: self-mini-macos + - run_tests_windows + runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4 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 }} + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} 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: run_bundling::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: 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 + - name: steps::setup_linux + run: ./script/linux + shell: bash -euxo pipefail {0} + - name: steps::install_mold + run: ./script/install-mold shell: bash -euxo pipefail {0} - - name: release_nightly::set_release_channel_to_nightly + - name: ./script/bundle-linux + run: ./script/bundle-linux + shell: bash -euxo pipefail {0} + - name: '@actions/upload-artifact zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz' + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + with: + name: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + path: target/release/zed-*.tar.gz + if-no-files-found: error + - name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz' + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + with: + name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + path: target/zed-remote-server-*.gz + if-no-files-found: error + outputs: + zed: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + timeout-minutes: 60 + bundle_linux_x86_64: + needs: + - check_style + - run_tests_windows + runs-on: namespace-profile-32x64-ubuntu-2004 + env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} + steps: + - name: steps::checkout_repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + clean: false + - name: run_bundling::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 x86_64-apple-darwin + - name: steps::setup_sentry + uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b + with: + token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: steps::setup_linux + run: ./script/linux shell: bash -euxo pipefail {0} - - name: release_nightly::upload_zed_nightly - run: script/upload-nightly macos x86_64 + - name: steps::install_mold + run: ./script/install-mold + shell: bash -euxo pipefail {0} + - name: ./script/bundle-linux + run: ./script/bundle-linux shell: bash -euxo pipefail {0} + - name: '@actions/upload-artifact zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz' + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + with: + name: zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz + path: target/release/zed-*.tar.gz + if-no-files-found: error + - name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz' + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + with: + name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz + path: target/zed-remote-server-*.gz + if-no-files-found: error + outputs: + zed: zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz + remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz timeout-minutes: 60 - bundle_mac_nightly_aarch64: + bundle_mac_aarch64: needs: - check_style - - run_tests_mac - if: github.repository_owner == 'zed-industries' + - run_tests_windows runs-on: self-mini-macos env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }} @@ -161,6 +181,13 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false + - name: run_bundling::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: steps::setup_node uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: @@ -172,100 +199,90 @@ jobs: - 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 + - name: run_bundling::bundle_mac::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} + - 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 + if-no-files-found: error + - 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-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-aarch64.gz + path: target/zed-remote-server-macos-aarch64.gz + if-no-files-found: error + outputs: + zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.dmg + remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-aarch64.gz timeout-minutes: 60 - bundle_linux_nightly_x86_64: + bundle_mac_x86_64: needs: - check_style - - run_tests_mac - if: github.repository_owner == 'zed-industries' - runs-on: namespace-profile-32x64-ubuntu-2004 + - run_tests_windows + runs-on: self-mini-macos + env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} + 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_sentry - uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b - with: - token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: ./script/linux - run: ./script/linux - shell: bash -euxo pipefail {0} - - name: ./script/install-mold - run: ./script/install-mold - shell: bash -euxo pipefail {0} - - name: steps::clear_target_dir_if_large - run: ./script/clear-target-dir-if-larger-than 100 - shell: bash -euxo pipefail {0} - - name: release_nightly::set_release_channel_to_nightly + - name: run_bundling::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: ./script/bundle-linux - run: ./script/bundle-linux - shell: bash -euxo pipefail {0} - - name: release_nightly::upload_zed_nightly - run: script/upload-nightly linux-targz x86_64 - shell: bash -euxo pipefail {0} - timeout-minutes: 60 - bundle_linux_nightly_aarch64: - needs: - - check_style - - run_tests_mac - if: github.repository_owner == 'zed-industries' - runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4 - steps: - - name: steps::checkout_repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: steps::setup_node + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: - clean: false + node-version: '20' - name: steps::setup_sentry uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: ./script/linux - run: ./script/linux - shell: bash -euxo pipefail {0} - name: steps::clear_target_dir_if_large - run: ./script/clear-target-dir-if-larger-than 100 - 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: ./script/bundle-linux - run: ./script/bundle-linux + run: ./script/clear-target-dir-if-larger-than 300 shell: bash -euxo pipefail {0} - - name: release_nightly::upload_zed_nightly - run: script/upload-nightly linux-targz aarch64 + - name: run_bundling::bundle_mac::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 + if-no-files-found: error + - 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 + if-no-files-found: error + outputs: + zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg + remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-x86_64.gz timeout-minutes: 60 - bundle_windows_nightly_x86_64: + bundle_windows_aarch64: needs: - check_style - run_tests_windows - if: github.repository_owner == 'zed-industries' runs-on: self-32vcpu-windows-2022 env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }} AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }} @@ -280,11 +297,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false - - name: steps::setup_sentry - uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b - with: - token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: release_nightly::set_release_channel_to_nightly + - name: run_bundling::set_release_channel_to_nightly run: | $ErrorActionPreference = "Stop" $version = git rev-parse --short HEAD @@ -292,22 +305,32 @@ jobs: "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL" shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} - - name: run_bundling::bundle_windows - run: script/bundle-windows.ps1 -Architecture x86_64 - shell: pwsh - working-directory: ${{ env.ZED_WORKSPACE }} - - name: release_nightly::upload_zed_nightly - run: script/upload-nightly.ps1 -Architecture x86_64 + - name: steps::setup_sentry + uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b + with: + token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: run_bundling::bundle_windows::bundle_windows + run: script/bundle-windows.ps1 -Architecture aarch64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} + - name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe' + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + with: + name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe + path: ${{ env.SETUP_PATH }} + if-no-files-found: error + outputs: + zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe timeout-minutes: 60 - bundle_windows_nightly_aarch64: + bundle_windows_x86_64: needs: - check_style - run_tests_windows - if: github.repository_owner == 'zed-industries' runs-on: self-32vcpu-windows-2022 env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }} AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }} @@ -322,11 +345,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false - - name: steps::setup_sentry - uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b - with: - token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: release_nightly::set_release_channel_to_nightly + - name: run_bundling::set_release_channel_to_nightly run: | $ErrorActionPreference = "Stop" $version = git rev-parse --short HEAD @@ -334,19 +353,27 @@ jobs: "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL" shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} - - name: run_bundling::bundle_windows - run: script/bundle-windows.ps1 -Architecture aarch64 - shell: pwsh - working-directory: ${{ env.ZED_WORKSPACE }} - - name: release_nightly::upload_zed_nightly - run: script/upload-nightly.ps1 -Architecture aarch64 + - name: steps::setup_sentry + uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b + with: + token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: run_bundling::bundle_windows::bundle_windows + run: script/bundle-windows.ps1 -Architecture x86_64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} + - name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe' + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + with: + name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe + path: ${{ env.SETUP_PATH }} + if-no-files-found: error + outputs: + zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe timeout-minutes: 60 build_nix_linux_x86_64: needs: - check_style - - run_tests_mac + - run_tests_windows if: github.repository_owner == 'zed-industries' runs-on: namespace-profile-32x64-ubuntu-2004 env: @@ -377,7 +404,7 @@ jobs: build_nix_mac_aarch64: needs: - check_style - - run_tests_mac + - run_tests_windows if: github.repository_owner == 'zed-industries' runs-on: self-mini-macos env: @@ -414,20 +441,48 @@ jobs: continue-on-error: true update_nightly_tag: needs: - - bundle_mac_nightly_x86_64 - - bundle_mac_nightly_aarch64 - - bundle_linux_nightly_x86_64 - - bundle_linux_nightly_aarch64 - - bundle_windows_nightly_x86_64 - - bundle_windows_nightly_aarch64 + - bundle_linux_aarch64 + - bundle_linux_x86_64 + - bundle_mac_aarch64 + - bundle_mac_x86_64 + - bundle_windows_aarch64 + - bundle_windows_x86_64 if: github.repository_owner == 'zed-industries' - runs-on: namespace-profile-2x4-ubuntu-2404 + runs-on: namespace-profile-4x8-ubuntu-2204 steps: - name: steps::checkout_repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false fetch-depth: 0 + - name: release::download_workflow_artifacts + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 + with: + path: ./artifacts/ + - name: ls -lR ./artifacts + run: ls -lR ./artifacts + shell: bash -euxo pipefail {0} + - name: release::prep_release_artifacts + run: |- + mkdir -p release-artifacts/ + + mv ./artifacts/${{ needs.bundle_mac_x86_64.outputs.zed }}/* release-artifacts/Zed-x86_64.dmg + mv ./artifacts/${{ needs.bundle_mac_aarch64.outputs.zed }}/* release-artifacts/Zed-aarch64.dmg + mv ./artifacts/${{ needs.bundle_windows_x86_64.outputs.zed }}/* release-artifacts/Zed-x86_64.exe + mv ./artifacts/${{ needs.bundle_windows_aarch64.outputs.zed }}/* release-artifacts/Zed-aarch64.exe + mv ./artifacts/${{ needs.bundle_linux_aarch64.outputs.zed }}/* release-artifacts/zed-linux-aarch64.tar.gz + mv ./artifacts/${{ needs.bundle_linux_x86_64.outputs.zed }}/* release-artifacts/zed-linux-x86_64.tar.gz + mv ./artifacts/${{ needs.bundle_linux_x86_64.outputs.remote-server }}/* release-artifacts/zed-remote-server-linux-x86_64.gz + mv ./artifacts/${{ needs.bundle_linux_aarch64.outputs.remote-server }}/* release-artifacts/zed-remote-server-linux-aarch64.gz + mv ./artifacts/${{ needs.bundle_mac_x86_64.outputs.remote-server }}/* release-artifacts/zed-remote-server-macos-x86_64.gz + mv ./artifacts/${{ needs.bundle_mac_aarch64.outputs.remote-server }}/* release-artifacts/zed-remote-server-macos-aarch64.gz + shell: bash -euxo pipefail {0} + - name: ./script/upload-nightly + run: ./script/upload-nightly + shell: bash -euxo pipefail {0} + env: + DIGITALOCEAN_SPACES_ACCESS_KEY: ${{ secrets.DIGITALOCEAN_SPACES_ACCESS_KEY }} + DIGITALOCEAN_SPACES_SECRET_KEY: ${{ secrets.DIGITALOCEAN_SPACES_SECRET_KEY }} - name: release_nightly::update_nightly_tag_job::update_nightly_tag run: | if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then diff --git a/.github/workflows/run_bundling.yml b/.github/workflows/run_bundling.yml index a6d563b5b12faa2d5f2cf03b644cfcacbdd17400..8379913d647fbb020088762da8577c569d9cd9ac 100644 --- a/.github/workflows/run_bundling.yml +++ b/.github/workflows/run_bundling.yml @@ -3,68 +3,108 @@ name: run_bundling env: CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: '0' RUST_BACKTRACE: '1' - ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} - ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} on: pull_request: types: - labeled - synchronize jobs: - bundle_mac_x86_64: + bundle_linux_aarch64: 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 + runs-on: namespace-profile-8x32-ubuntu-2004-arm-m4 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 }} + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} steps: - name: steps::checkout_repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: clean: false - - name: steps::setup_node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + - name: steps::setup_sentry + uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: - node-version: '20' + token: ${{ secrets.SENTRY_AUTH_TOKEN }} + - name: steps::setup_linux + run: ./script/linux + shell: bash -euxo pipefail {0} + - name: steps::install_mold + run: ./script/install-mold + shell: bash -euxo pipefail {0} + - name: ./script/bundle-linux + run: ./script/bundle-linux + shell: bash -euxo pipefail {0} + - name: '@actions/upload-artifact zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz' + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + with: + name: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + path: target/release/zed-*.tar.gz + if-no-files-found: error + - name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz' + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + with: + name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + path: target/zed-remote-server-*.gz + if-no-files-found: error + outputs: + zed: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + timeout-minutes: 60 + bundle_linux_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')) + runs-on: namespace-profile-32x64-ubuntu-2004 + env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} + steps: + - name: steps::checkout_repo + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + with: + clean: false - 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 + - name: steps::setup_linux + run: ./script/linux shell: bash -euxo pipefail {0} - - name: run_bundling::bundle_mac - run: ./script/bundle-mac x86_64-apple-darwin + - name: steps::install_mold + run: ./script/install-mold shell: bash -euxo pipefail {0} - - name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg' + - name: ./script/bundle-linux + run: ./script/bundle-linux + shell: bash -euxo pipefail {0} + - name: '@actions/upload-artifact zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.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-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz + path: target/release/zed-*.tar.gz if-no-files-found: error - - name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-x86_64.gz' + - name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.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 + name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz + path: target/zed-remote-server-*.gz if-no-files-found: error outputs: - zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg - remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-x86_64.gz + zed: zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz + remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz timeout-minutes: 60 - bundle_mac_arm64: + bundle_mac_aarch64: 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: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} APPLE_NOTARIZATION_KEY: ${{ secrets.APPLE_NOTARIZATION_KEY }} @@ -86,7 +126,7 @@ jobs: - 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 + - name: run_bundling::bundle_mac::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' @@ -105,90 +145,64 @@ jobs: zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.dmg remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-aarch64.gz timeout-minutes: 60 - bundle_linux_x86_64: + 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')) - runs-on: namespace-profile-32x64-ubuntu-2004 + runs-on: self-mini-macos + env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} + 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_sentry - uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b - with: - token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: steps::setup_linux - run: ./script/linux - shell: bash -euxo pipefail {0} - - name: steps::install_mold - run: ./script/install-mold - shell: bash -euxo pipefail {0} - - name: ./script/bundle-linux - run: ./script/bundle-linux - shell: bash -euxo pipefail {0} - - name: '@actions/upload-artifact zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz' - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 - with: - name: zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz - path: target/release/zed-*.tar.gz - if-no-files-found: error - - name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz' - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 - with: - name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz - path: target/zed-remote-server-*.gz - if-no-files-found: error - outputs: - zed: zed-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz - remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-x86_64-unknown-linux-gnu.tar.gz - timeout-minutes: 60 - bundle_linux_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: namespace-profile-8x32-ubuntu-2004-arm-m4 - steps: - - name: steps::checkout_repo - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: steps::setup_node + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 with: - clean: false + node-version: '20' - name: steps::setup_sentry uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: steps::setup_linux - run: ./script/linux - shell: bash -euxo pipefail {0} - - name: steps::install_mold - run: ./script/install-mold + - name: steps::clear_target_dir_if_large + run: ./script/clear-target-dir-if-larger-than 300 shell: bash -euxo pipefail {0} - - name: ./script/bundle-linux - run: ./script/bundle-linux + - name: run_bundling::bundle_mac::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 }}-aarch64-unknown-linux-gnu.tar.gz' + - 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 }}-aarch64-unknown-linux-gnu.tar.gz - path: target/release/zed-*.tar.gz + name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg + path: target/x86_64-apple-darwin/release/Zed.dmg if-no-files-found: error - - name: '@actions/upload-artifact zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz' + - 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 }}-aarch64-unknown-linux-gnu.tar.gz - path: target/zed-remote-server-*.gz + 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 if-no-files-found: error outputs: - zed: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz - remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg + remote-server: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-x86_64.gz timeout-minutes: 60 - bundle_windows_x86_64: + bundle_windows_aarch64: 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-32vcpu-windows-2022 env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }} AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }} @@ -207,25 +221,28 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: run_bundling::bundle_windows - run: script/bundle-windows.ps1 -Architecture x86_64 + - name: run_bundling::bundle_windows::bundle_windows + run: script/bundle-windows.ps1 -Architecture aarch64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} - - name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe' + - name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe + name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe path: ${{ env.SETUP_PATH }} if-no-files-found: error outputs: - zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe + zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe timeout-minutes: 60 - bundle_windows_arm64: + bundle_windows_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')) runs-on: self-32vcpu-windows-2022 env: + CARGO_INCREMENTAL: 0 + ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }} + ZED_MINIDUMP_ENDPOINT: ${{ secrets.ZED_SENTRY_MINIDUMP_ENDPOINT }} AZURE_TENANT_ID: ${{ secrets.AZURE_SIGNING_TENANT_ID }} AZURE_CLIENT_ID: ${{ secrets.AZURE_SIGNING_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_SIGNING_CLIENT_SECRET }} @@ -244,18 +261,18 @@ jobs: uses: matbour/setup-sentry-cli@3e938c54b3018bdd019973689ef984e033b0454b with: token: ${{ secrets.SENTRY_AUTH_TOKEN }} - - name: run_bundling::bundle_windows - run: script/bundle-windows.ps1 -Architecture aarch64 + - name: run_bundling::bundle_windows::bundle_windows + run: script/bundle-windows.ps1 -Architecture x86_64 shell: pwsh working-directory: ${{ env.ZED_WORKSPACE }} - - name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe' + - name: '@actions/upload-artifact Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe + name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe path: ${{ env.SETUP_PATH }} if-no-files-found: error outputs: - zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe + zed: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe timeout-minutes: 60 concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 51ff9ee331ca69b251bb00905e22213527cbf118..1cc70f8a4669d5e85b7e4b1f3756ff2e468c13a3 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -4,7 +4,6 @@ name: run_tests env: CARGO_TERM_COLOR: always RUST_BACKTRACE: '1' - CARGO_INCREMENTAL: '0' on: pull_request: branches: diff --git a/script/upload-nightly b/script/upload-nightly index 985c43936457f53d1db72e4436434aa0ee59296a..6f629ef98acd6784833d21f7d3e93dae95aee815 100755 --- a/script/upload-nightly +++ b/script/upload-nightly @@ -1,75 +1,16 @@ #!/usr/bin/env bash -# Based on the template in: https://docs.digitalocean.com/reference/api/spaces-api/ bash -euo pipefail source script/lib/blob-store.sh -allowed_targets=("linux-targz" "macos" "freebsd") -is_allowed_target() { - for val in "${allowed_targets[@]}"; do - if [[ "$1" == "$val" ]]; then - return 0 - fi - done - return 1 -} - -allowed_arch=("x86_64" "aarch64") -is_allowed_arch() { - for val in "${allowed_arch[@]}"; do - if [[ "$1" == "$val" ]]; then - return 0 - fi - done - return 1 -} - -if is_allowed_target "$1"; then - target="$1" -else - echo "Error: Target '$1' is not allowed" - echo "Usage: $0 [${allowed_targets[*]}] {arch}" - exit 1 -fi -if is_allowed_arch "$2"; then - arch="$2" -else - echo "Error: Arch '$2' is not allowed" - echo "Usage: $0 $1 [${allowed_arch[*]}]" - exit 1 -fi -echo "Uploading nightly for target: $target $arch" - bucket_name="zed-nightly-host" sha=$(git rev-parse HEAD) -echo ${sha} > target/latest-sha +echo ${sha} > ./release-artifacts/latest-sha -find target -type f -name "zed-remote-server-*.gz" -print0 | while IFS= read -r -d '' file_to_upload; do +for file_to_upload in ./release-artifacts/*; do + [ -f "$file_to_upload" ] || continue upload_to_blob_store $bucket_name "$file_to_upload" "nightly/$(basename "$file_to_upload")" + upload_to_blob_store $bucket_name "$file_to_upload" "${GITHUB_SHA}/$(basename "$file_to_upload")" rm -f "$file_to_upload" done - -case "$target" in - macos) - upload_to_blob_store $bucket_name "target/$arch-apple-darwin/release/Zed.dmg" "nightly/Zed-$arch.dmg" - upload_to_blob_store $bucket_name "target/latest-sha" "nightly/latest-sha" - rm -f "target/$arch-apple-darwin/release/Zed.dmg" "target/release/Zed.dmg" - rm -f "target/latest-sha" - ;; - linux-targz) - find . -type f -name "zed-*.tar.gz" -print0 | while IFS= read -r -d '' file_to_upload; do - upload_to_blob_store $bucket_name "$file_to_upload" "nightly/$(basename "$file_to_upload")" - rm -f "$file_to_upload" - done - upload_to_blob_store $bucket_name "target/latest-sha" "nightly/latest-sha-linux-targz" - rm -f "target/latest-sha" - ;; - freebsd) - echo "No freebsd client build (yet)." - ;; - *) - echo "Error: Unknown target '$target'" - exit 1 - ;; -esac diff --git a/tooling/xtask/src/tasks/workflows/release.rs b/tooling/xtask/src/tasks/workflows/release.rs index c3d86192fd0e17c268a235292cf24223622094e1..d71b938eda8749a2d6b29b99f42ae1218e7818de 100644 --- a/tooling/xtask/src/tasks/workflows/release.rs +++ b/tooling/xtask/src/tasks/workflows/release.rs @@ -1,8 +1,10 @@ use gh_workflow::{Event, Expression, Push, Run, Step, Use, Workflow}; use crate::tasks::workflows::{ - run_bundling, run_tests, runners, - steps::{self, NamedJob, dependant_job, named, release_job}, + run_bundling::{bundle_linux, bundle_mac, bundle_windows}, + run_tests, + runners::{self, Arch}, + steps::{self, FluentBuilder, NamedJob, dependant_job, named, release_job}, vars, }; @@ -15,12 +17,12 @@ pub(crate) fn release() -> Workflow { let create_draft_release = create_draft_release(); let bundle = ReleaseBundleJobs { - linux_arm64: bundle_linux_arm64(&[&linux_tests, &check_scripts]), - linux_x86_64: bundle_linux_x86_64(&[&linux_tests, &check_scripts]), - mac_arm64: bundle_mac_arm64(&[&macos_tests, &check_scripts]), - mac_x86_64: bundle_mac_x86_64(&[&macos_tests, &check_scripts]), - windows_arm64: bundle_windows_arm64(&[&windows_tests, &check_scripts]), - windows_x86_64: bundle_windows_x86_64(&[&windows_tests, &check_scripts]), + linux_aarch64: bundle_linux(Arch::AARCH64, None, &[&linux_tests, &check_scripts]), + linux_x86_64: bundle_linux(Arch::X86_64, None, &[&linux_tests, &check_scripts]), + mac_aarch64: bundle_mac(Arch::AARCH64, None, &[&macos_tests, &check_scripts]), + mac_x86_64: bundle_mac(Arch::X86_64, None, &[&macos_tests, &check_scripts]), + windows_aarch64: bundle_windows(Arch::AARCH64, None, &[&windows_tests, &check_scripts]), + windows_x86_64: bundle_windows(Arch::X86_64, None, &[&windows_tests, &check_scripts]), }; let upload_release_assets = upload_release_assets(&[&create_draft_release], &bundle); @@ -31,32 +33,53 @@ pub(crate) fn release() -> Workflow { .on(Event::default().push(Push::default().tags(vec!["v*".to_string()]))) .concurrency(vars::one_workflow_per_non_main_branch()) .add_env(("CARGO_TERM_COLOR", "always")) - .add_env(("CARGO_INCREMENTAL", "0")) .add_env(("RUST_BACKTRACE", "1")) - .add_env(("ZED_CLIENT_CHECKSUM_SEED", vars::ZED_CLIENT_CHECKSUM_SEED)) - .add_env(("ZED_MINIDUMP_ENDPOINT", vars::ZED_SENTRY_MINIDUMP_ENDPOINT)) .add_job(macos_tests.name, macos_tests.job) .add_job(linux_tests.name, linux_tests.job) .add_job(windows_tests.name, windows_tests.job) .add_job(check_scripts.name, check_scripts.job) .add_job(create_draft_release.name, create_draft_release.job) - .add_job(bundle.linux_arm64.name, bundle.linux_arm64.job) - .add_job(bundle.linux_x86_64.name, bundle.linux_x86_64.job) - .add_job(bundle.mac_arm64.name, bundle.mac_arm64.job) - .add_job(bundle.mac_x86_64.name, bundle.mac_x86_64.job) - .add_job(bundle.windows_arm64.name, bundle.windows_arm64.job) - .add_job(bundle.windows_x86_64.name, bundle.windows_x86_64.job) + .map(|mut workflow| { + for job in bundle.into_jobs() { + workflow = workflow.add_job(job.name, job.job); + } + workflow + }) .add_job(upload_release_assets.name, upload_release_assets.job) .add_job(auto_release_preview.name, auto_release_preview.job) } -struct ReleaseBundleJobs { - linux_arm64: NamedJob, - linux_x86_64: NamedJob, - mac_arm64: NamedJob, - mac_x86_64: NamedJob, - windows_arm64: NamedJob, - windows_x86_64: NamedJob, +pub(crate) struct ReleaseBundleJobs { + pub linux_aarch64: NamedJob, + pub linux_x86_64: NamedJob, + pub mac_aarch64: NamedJob, + pub mac_x86_64: NamedJob, + pub windows_aarch64: NamedJob, + pub windows_x86_64: NamedJob, +} + +impl ReleaseBundleJobs { + pub fn jobs<'a>(&'a self) -> Vec<&'a NamedJob> { + vec![ + &self.linux_aarch64, + &self.linux_x86_64, + &self.mac_aarch64, + &self.mac_x86_64, + &self.windows_aarch64, + &self.windows_x86_64, + ] + } + + pub fn into_jobs<'a>(self) -> Vec { + vec![ + self.linux_aarch64, + self.linux_x86_64, + self.mac_aarch64, + self.mac_x86_64, + self.windows_aarch64, + self.windows_x86_64, + ] + } } fn auto_release_preview(deps: &[&NamedJob; 1]) -> NamedJob { @@ -92,75 +115,70 @@ fn auto_release_preview(deps: &[&NamedJob; 1]) -> NamedJob { ) } -fn upload_release_assets(deps: &[&NamedJob], bundle_jobs: &ReleaseBundleJobs) -> NamedJob { - fn download_workflow_artifacts() -> Step { - named::uses( - "actions", - "download-artifact", - "018cc2cf5baa6db3ef3c5f8a56943fffe632ef53", // v6.0.0 - ) - .add_with(("path", "./artifacts/")) - } +pub(crate) fn download_workflow_artifacts() -> Step { + named::uses( + "actions", + "download-artifact", + "018cc2cf5baa6db3ef3c5f8a56943fffe632ef53", // v6.0.0 + ) + .add_with(("path", "./artifacts/")) +} - fn prep_release_artifacts(bundle: &ReleaseBundleJobs) -> Step { - let assets = [ - (&bundle.mac_x86_64.name, "zed", "Zed-x86_64.dmg"), - (&bundle.mac_arm64.name, "zed", "Zed-aarch64.dmg"), - (&bundle.windows_x86_64.name, "zed", "Zed-x86_64.exe"), - (&bundle.windows_arm64.name, "zed", "Zed-aarch64.exe"), - (&bundle.linux_arm64.name, "zed", "zed-linux-aarch64.tar.gz"), - (&bundle.linux_x86_64.name, "zed", "zed-linux-x86_64.tar.gz"), - ( - &bundle.linux_x86_64.name, - "remote-server", - "zed-remote-server-linux-x86_64.gz", - ), - ( - &bundle.linux_arm64.name, - "remote-server", - "zed-remote-server-linux-aarch64.gz", - ), - ( - &bundle.mac_x86_64.name, - "remote-server", - "zed-remote-server-macos-x86_64.gz", - ), - ( - &bundle.mac_arm64.name, - "remote-server", - "zed-remote-server-macos-aarch64.gz", - ), - ]; - - let mut script_lines = vec!["mkdir -p release-artifacts/\n".to_string()]; - for (job_name, artifact_kind, release_artifact_name) in assets { - let artifact_path = - ["${{ needs.", job_name, ".outputs.", artifact_kind, " }}"].join(""); - let mv_command = format!( - "mv ./artifacts/{artifact_path}/* release-artifacts/{release_artifact_name}" - ); - script_lines.push(mv_command) - } - - named::bash(&script_lines.join("\n")) +pub(crate) fn prep_release_artifacts(bundle: &ReleaseBundleJobs) -> Step { + let assets = [ + (&bundle.mac_x86_64.name, "zed", "Zed-x86_64.dmg"), + (&bundle.mac_aarch64.name, "zed", "Zed-aarch64.dmg"), + (&bundle.windows_x86_64.name, "zed", "Zed-x86_64.exe"), + (&bundle.windows_aarch64.name, "zed", "Zed-aarch64.exe"), + ( + &bundle.linux_aarch64.name, + "zed", + "zed-linux-aarch64.tar.gz", + ), + (&bundle.linux_x86_64.name, "zed", "zed-linux-x86_64.tar.gz"), + ( + &bundle.linux_x86_64.name, + "remote-server", + "zed-remote-server-linux-x86_64.gz", + ), + ( + &bundle.linux_aarch64.name, + "remote-server", + "zed-remote-server-linux-aarch64.gz", + ), + ( + &bundle.mac_x86_64.name, + "remote-server", + "zed-remote-server-macos-x86_64.gz", + ), + ( + &bundle.mac_aarch64.name, + "remote-server", + "zed-remote-server-macos-aarch64.gz", + ), + ]; + + let mut script_lines = vec!["mkdir -p release-artifacts/\n".to_string()]; + for (job_name, artifact_kind, release_artifact_name) in assets { + let artifact_path = ["${{ needs.", job_name, ".outputs.", artifact_kind, " }}"].join(""); + let mv_command = + format!("mv ./artifacts/{artifact_path}/* release-artifacts/{release_artifact_name}"); + script_lines.push(mv_command) } + named::bash(&script_lines.join("\n")) +} + +fn upload_release_assets(deps: &[&NamedJob], bundle: &ReleaseBundleJobs) -> NamedJob { let mut deps = deps.to_vec(); - deps.extend([ - &bundle_jobs.linux_arm64, - &bundle_jobs.linux_x86_64, - &bundle_jobs.mac_arm64, - &bundle_jobs.mac_x86_64, - &bundle_jobs.windows_arm64, - &bundle_jobs.windows_x86_64, - ]); + deps.extend(bundle.jobs()); named::job( dependant_job(&deps) .runs_on(runners::LINUX_MEDIUM) .add_step(download_workflow_artifacts()) .add_step(steps::script("ls -lR ./artifacts")) - .add_step(prep_release_artifacts(bundle_jobs)) + .add_step(prep_release_artifacts(bundle)) .add_step( steps::script("gh release upload \"$GITHUB_REF_NAME\" --repo=zed-industries/zed release-artifacts/*") .add_env(("GITHUB_TOKEN", "${{ secrets.GITHUB_TOKEN }}")), @@ -199,25 +217,3 @@ fn create_draft_release() -> NamedJob { .add_step(create_release()), ) } - -fn bundle_mac_x86_64(deps: &[&NamedJob]) -> NamedJob { - named::job(run_bundling::bundle_mac_job(runners::Arch::X86_64, deps)) -} -fn bundle_mac_arm64(deps: &[&NamedJob]) -> NamedJob { - named::job(run_bundling::bundle_mac_job(runners::Arch::ARM64, deps)) -} -fn bundle_linux_x86_64(deps: &[&NamedJob]) -> NamedJob { - named::job(run_bundling::bundle_linux_job(runners::Arch::X86_64, deps)) -} -fn bundle_linux_arm64(deps: &[&NamedJob]) -> NamedJob { - named::job(run_bundling::bundle_linux_job(runners::Arch::ARM64, deps)) -} -fn bundle_windows_x86_64(deps: &[&NamedJob]) -> NamedJob { - named::job(run_bundling::bundle_windows_job( - runners::Arch::X86_64, - deps, - )) -} -fn bundle_windows_arm64(deps: &[&NamedJob]) -> NamedJob { - named::job(run_bundling::bundle_windows_job(runners::Arch::ARM64, deps)) -} diff --git a/tooling/xtask/src/tasks/workflows/release_nightly.rs b/tooling/xtask/src/tasks/workflows/release_nightly.rs index 7079cdbf028c31a27eb9cc230c7c93eb67367680..053570b438589a77b1f0e9fdf04537a97ee37491 100644 --- a/tooling/xtask/src/tasks/workflows/release_nightly.rs +++ b/tooling/xtask/src/tasks/workflows/release_nightly.rs @@ -1,10 +1,10 @@ use crate::tasks::workflows::{ nix_build::build_nix, - run_bundling::{bundle_mac, bundle_windows}, + release::{ReleaseBundleJobs, download_workflow_artifacts, prep_release_artifacts}, + run_bundling::{bundle_linux, bundle_mac, bundle_windows}, run_tests::run_platform_tests, - runners::{Arch, Platform}, - steps::NamedJob, - vars::{mac_bundle_envs, windows_bundle_envs}, + runners::{Arch, Platform, ReleaseChannel}, + steps::{FluentBuilder, NamedJob}, }; use super::{runners, steps, steps::named, vars}; @@ -13,34 +13,24 @@ use indexmap::IndexMap; /// Generates the release_nightly.yml workflow pub fn release_nightly() -> Workflow { - let env: IndexMap<_, _> = [ - ("CARGO_TERM_COLOR", "always"), - ("CARGO_INCREMENTAL", "0"), - ("RUST_BACKTRACE", "1"), - ("ZED_CLIENT_CHECKSUM_SEED", vars::ZED_CLIENT_CHECKSUM_SEED), - ("ZED_MINIDUMP_ENDPOINT", vars::ZED_SENTRY_MINIDUMP_ENDPOINT), - ( - "DIGITALOCEAN_SPACES_ACCESS_KEY", - vars::DIGITALOCEAN_SPACES_ACCESS_KEY, - ), - ( - "DIGITALOCEAN_SPACES_SECRET_KEY", - vars::DIGITALOCEAN_SPACES_SECRET_KEY, - ), - ] - .into_iter() - .map(|(key, value)| (key.into(), value.into())) - .collect(); + let env: IndexMap<_, _> = [("CARGO_TERM_COLOR", "always"), ("RUST_BACKTRACE", "1")] + .into_iter() + .map(|(key, value)| (key.into(), value.into())) + .collect(); let style = check_style(); - let tests = run_platform_tests(Platform::Mac); - let windows_tests = run_platform_tests(Platform::Windows); - let bundle_mac_x86 = bundle_mac_nightly(Arch::X86_64, &[&style, &tests]); - let bundle_mac_arm = bundle_mac_nightly(Arch::ARM64, &[&style, &tests]); - let linux_x86 = bundle_linux_nightly(Arch::X86_64, &[&style, &tests]); - let linux_arm = bundle_linux_nightly(Arch::ARM64, &[&style, &tests]); - let windows_x86 = bundle_windows_nightly(Arch::X86_64, &[&style, &windows_tests]); - let windows_arm = bundle_windows_nightly(Arch::ARM64, &[&style, &windows_tests]); + // run only on windows as that's our fastest platform right now. + let tests = run_platform_tests(Platform::Windows); + let nightly = Some(ReleaseChannel::Nightly); + + let bundle = ReleaseBundleJobs { + linux_aarch64: bundle_linux(Arch::AARCH64, nightly, &[&style, &tests]), + linux_x86_64: bundle_linux(Arch::X86_64, nightly, &[&style, &tests]), + mac_aarch64: bundle_mac(Arch::AARCH64, nightly, &[&style, &tests]), + mac_x86_64: bundle_mac(Arch::X86_64, nightly, &[&style, &tests]), + windows_aarch64: bundle_windows(Arch::AARCH64, nightly, &[&style, &tests]), + windows_x86_64: bundle_windows(Arch::X86_64, nightly, &[&style, &tests]), + }; let nix_linux_x86 = build_nix( Platform::Linux, @@ -51,19 +41,12 @@ pub fn release_nightly() -> Workflow { ); let nix_mac_arm = build_nix( Platform::Mac, - Arch::ARM64, + Arch::AARCH64, "default", None, &[&style, &tests], ); - let update_nightly_tag = update_nightly_tag_job(&[ - &bundle_mac_x86, - &bundle_mac_arm, - &linux_x86, - &linux_arm, - &windows_x86, - &windows_arm, - ]); + let update_nightly_tag = update_nightly_tag_job(&bundle); named::workflow() .on(Event::default() @@ -73,13 +56,12 @@ pub fn release_nightly() -> Workflow { .envs(env) .add_job(style.name, style.job) .add_job(tests.name, tests.job) - .add_job(windows_tests.name, windows_tests.job) - .add_job(bundle_mac_x86.name, bundle_mac_x86.job) - .add_job(bundle_mac_arm.name, bundle_mac_arm.job) - .add_job(linux_x86.name, linux_x86.job) - .add_job(linux_arm.name, linux_arm.job) - .add_job(windows_x86.name, windows_x86.job) - .add_job(windows_arm.name, windows_arm.job) + .map(|mut workflow| { + for job in bundle.into_jobs() { + workflow = workflow.add_job(job.name, job.job); + } + workflow + }) .add_job(nix_linux_x86.name, nix_linux_x86.job) .add_job(nix_mac_arm.name, nix_mac_arm.job) .add_job(update_nightly_tag.name, update_nightly_tag.job) @@ -112,62 +94,7 @@ fn release_job(deps: &[&NamedJob]) -> Job { } } -fn bundle_mac_nightly(arch: Arch, deps: &[&NamedJob]) -> NamedJob { - let platform = Platform::Mac; - NamedJob { - name: format!("bundle_mac_nightly_{arch}"), - job: release_job(deps) - .runs_on(runners::MAC_DEFAULT) - .envs(mac_bundle_envs()) - .add_step(steps::checkout_repo()) - .add_step(steps::setup_node()) - .add_step(steps::setup_sentry()) - .add_step(steps::clear_target_dir_if_large(platform)) - .add_step(set_release_channel_to_nightly(platform)) - .add_step(bundle_mac(arch)) - .add_step(upload_zed_nightly(platform, arch)), - } -} - -fn bundle_linux_nightly(arch: Arch, deps: &[&NamedJob]) -> NamedJob { - let platform = Platform::Linux; - let mut job = steps::release_job(deps) - .runs_on(arch.linux_bundler()) - .add_step(steps::checkout_repo()) - .add_step(steps::setup_sentry()) - .add_step(steps::script("./script/linux")); - - // todo(ci) can we do this on arm too? - if arch == Arch::X86_64 { - job = job.add_step(steps::script("./script/install-mold")); - } - job = job - .add_step(steps::clear_target_dir_if_large(platform)) - .add_step(set_release_channel_to_nightly(platform)) - .add_step(steps::script("./script/bundle-linux")) - .add_step(upload_zed_nightly(platform, arch)); - NamedJob { - name: format!("bundle_linux_nightly_{arch}"), - job, - } -} - -fn bundle_windows_nightly(arch: Arch, deps: &[&NamedJob]) -> NamedJob { - let platform = Platform::Windows; - NamedJob { - name: format!("bundle_windows_nightly_{arch}"), - job: steps::release_job(deps) - .runs_on(runners::WINDOWS_DEFAULT) - .envs(windows_bundle_envs()) - .add_step(steps::checkout_repo()) - .add_step(steps::setup_sentry()) - .add_step(set_release_channel_to_nightly(platform)) - .add_step(bundle_windows(arch)) - .add_step(upload_zed_nightly(platform, arch)), - } -} - -fn update_nightly_tag_job(deps: &[&NamedJob]) -> NamedJob { +fn update_nightly_tag_job(bundle: &ReleaseBundleJobs) -> NamedJob { fn update_nightly_tag() -> Step { named::bash(indoc::indoc! {r#" if [ "$(git rev-parse nightly)" = "$(git rev-parse HEAD)" ]; then @@ -195,42 +122,24 @@ fn update_nightly_tag_job(deps: &[&NamedJob]) -> NamedJob { NamedJob { name: "update_nightly_tag".to_owned(), - job: steps::release_job(deps) - .runs_on(runners::LINUX_SMALL) + job: steps::release_job(&bundle.jobs()) + .runs_on(runners::LINUX_MEDIUM) .add_step(steps::checkout_repo().add_with(("fetch-depth", 0))) + .add_step(download_workflow_artifacts()) + .add_step(steps::script("ls -lR ./artifacts")) + .add_step(prep_release_artifacts(bundle)) + .add_step( + steps::script("./script/upload-nightly") + .add_env(( + "DIGITALOCEAN_SPACES_ACCESS_KEY", + vars::DIGITALOCEAN_SPACES_ACCESS_KEY, + )) + .add_env(( + "DIGITALOCEAN_SPACES_SECRET_KEY", + vars::DIGITALOCEAN_SPACES_SECRET_KEY, + )), + ) .add_step(update_nightly_tag()) .add_step(create_sentry_release()), } } - -fn set_release_channel_to_nightly(platform: Platform) -> Step { - match platform { - Platform::Linux | Platform::Mac => named::bash(indoc::indoc! {r#" - set -eu - version=$(git rev-parse --short HEAD) - echo "Publishing version: ${version} on release channel nightly" - echo "nightly" > crates/zed/RELEASE_CHANNEL - "#}), - Platform::Windows => named::pwsh(indoc::indoc! {r#" - $ErrorActionPreference = "Stop" - $version = git rev-parse --short HEAD - Write-Host "Publishing version: $version on release channel nightly" - "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL" - "#}) - .working_directory("${{ env.ZED_WORKSPACE }}"), - } -} - -fn upload_zed_nightly(platform: Platform, arch: Arch) -> Step { - match platform { - Platform::Linux => named::bash(&format!("script/upload-nightly linux-targz {arch}")), - Platform::Mac => named::bash(&format!("script/upload-nightly macos {arch}")), - Platform::Windows => { - let cmd = match arch { - Arch::X86_64 => "script/upload-nightly.ps1 -Architecture x86_64", - Arch::ARM64 => "script/upload-nightly.ps1 -Architecture aarch64", - }; - named::pwsh(cmd).working_directory("${{ env.ZED_WORKSPACE }}") - } - } -} diff --git a/tooling/xtask/src/tasks/workflows/run_bundling.rs b/tooling/xtask/src/tasks/workflows/run_bundling.rs index be163b215bace76c411145d0ad04d8a9dd7788ca..ed7f7b39b24788b662ed834e7fbcd9191895f322 100644 --- a/tooling/xtask/src/tasks/workflows/run_bundling.rs +++ b/tooling/xtask/src/tasks/workflows/run_bundling.rs @@ -1,6 +1,8 @@ use crate::tasks::workflows::{ + release::ReleaseBundleJobs, + runners::{Arch, Platform, ReleaseChannel}, steps::{FluentBuilder, NamedJob, dependant_job, named}, - vars::{mac_bundle_envs, windows_bundle_envs}, + vars::bundle_envs, }; use super::{runners, steps, vars}; @@ -8,6 +10,14 @@ use gh_workflow::*; use indexmap::IndexMap; pub fn run_bundling() -> Workflow { + let bundle = ReleaseBundleJobs { + linux_aarch64: bundle_linux(Arch::AARCH64, None, &[]), + linux_x86_64: bundle_linux(Arch::X86_64, None, &[]), + mac_aarch64: bundle_mac(Arch::AARCH64, None, &[]), + mac_x86_64: bundle_mac(Arch::X86_64, None, &[]), + windows_aarch64: bundle_windows(Arch::AARCH64, None, &[]), + windows_x86_64: bundle_windows(Arch::X86_64, None, &[]), + }; named::workflow() .on(Event::default().pull_request( PullRequest::default().types([PullRequestType::Labeled, PullRequestType::Synchronize]), @@ -19,34 +29,13 @@ pub fn run_bundling() -> Workflow { .cancel_in_progress(true), ) .add_env(("CARGO_TERM_COLOR", "always")) - .add_env(("CARGO_INCREMENTAL", "0")) .add_env(("RUST_BACKTRACE", "1")) - .add_env(("ZED_CLIENT_CHECKSUM_SEED", vars::ZED_CLIENT_CHECKSUM_SEED)) - .add_env(("ZED_MINIDUMP_ENDPOINT", vars::ZED_SENTRY_MINIDUMP_ENDPOINT)) - .add_job( - "bundle_mac_x86_64", - bundle_mac_job(runners::Arch::X86_64, &[]), - ) - .add_job( - "bundle_mac_arm64", - bundle_mac_job(runners::Arch::ARM64, &[]), - ) - .add_job( - "bundle_linux_x86_64", - bundle_linux_job(runners::Arch::X86_64, &[]), - ) - .add_job( - "bundle_linux_arm64", - bundle_linux_job(runners::Arch::ARM64, &[]), - ) - .add_job( - "bundle_windows_x86_64", - bundle_windows_job(runners::Arch::X86_64, &[]), - ) - .add_job( - "bundle_windows_arm64", - bundle_windows_job(runners::Arch::ARM64, &[]), - ) + .map(|mut workflow| { + for job in bundle.into_jobs() { + workflow = workflow.add_job(job.name, job.job); + } + workflow + }) } fn bundle_job(deps: &[&NamedJob]) -> Job { @@ -59,95 +48,154 @@ fn bundle_job(deps: &[&NamedJob]) -> Job { .timeout_minutes(60u32) } -pub(crate) fn bundle_mac_job(arch: runners::Arch, deps: &[&NamedJob]) -> Job { +pub(crate) fn bundle_mac( + arch: runners::Arch, + release_channel: Option, + deps: &[&NamedJob], +) -> NamedJob { + pub fn bundle_mac(arch: runners::Arch) -> Step { + named::bash(&format!("./script/bundle-mac {arch}-apple-darwin")) + } use vars::GITHUB_SHA; + let platform = Platform::Mac; let artifact_name = format!("Zed_{GITHUB_SHA}-{arch}.dmg"); let remote_server_artifact_name = format!("zed-remote-server-{GITHUB_SHA}-macos-{arch}.gz"); - bundle_job(deps) - .runs_on(runners::MAC_DEFAULT) - .envs(mac_bundle_envs()) - .add_step(steps::checkout_repo()) - .add_step(steps::setup_node()) - .add_step(steps::setup_sentry()) - .add_step(steps::clear_target_dir_if_large(runners::Platform::Mac)) - .add_step(bundle_mac(arch)) - .add_step(steps::upload_artifact( - &artifact_name, - &format!("target/{arch}-apple-darwin/release/Zed.dmg"), - )) - .add_step(steps::upload_artifact( - &remote_server_artifact_name, - &format!("target/zed-remote-server-macos-{arch}.gz"), - )) - .outputs( - [ - ("zed".to_string(), artifact_name), - ("remote-server".to_string(), remote_server_artifact_name), - ] - .into_iter() - .collect::>(), - ) -} - -pub fn bundle_mac(arch: runners::Arch) -> Step { - named::bash(&format!("./script/bundle-mac {arch}-apple-darwin")) + NamedJob { + name: format!("bundle_mac_{arch}"), + job: bundle_job(deps) + .runs_on(runners::MAC_DEFAULT) + .envs(bundle_envs(platform)) + .add_step(steps::checkout_repo()) + .when_some(release_channel, |job, release_channel| { + job.add_step(set_release_channel(platform, release_channel)) + }) + .add_step(steps::setup_node()) + .add_step(steps::setup_sentry()) + .add_step(steps::clear_target_dir_if_large(runners::Platform::Mac)) + .add_step(bundle_mac(arch)) + .add_step(steps::upload_artifact( + &artifact_name, + &format!("target/{arch}-apple-darwin/release/Zed.dmg"), + )) + .add_step(steps::upload_artifact( + &remote_server_artifact_name, + &format!("target/zed-remote-server-macos-{arch}.gz"), + )) + .outputs( + [ + ("zed".to_string(), artifact_name), + ("remote-server".to_string(), remote_server_artifact_name), + ] + .into_iter() + .collect::>(), + ), + } } -pub(crate) fn bundle_linux_job(arch: runners::Arch, deps: &[&NamedJob]) -> Job { +pub(crate) fn bundle_linux( + arch: runners::Arch, + release_channel: Option, + deps: &[&NamedJob], +) -> NamedJob { + let platform = Platform::Linux; let artifact_name = format!("zed-{}-{}.tar.gz", vars::GITHUB_SHA, arch.triple()); let remote_server_artifact_name = format!( "zed-remote-server-{}-{}.tar.gz", vars::GITHUB_SHA, arch.triple() ); - bundle_job(deps) - .runs_on(arch.linux_bundler()) - .add_step(steps::checkout_repo()) - .add_step(steps::setup_sentry()) - .map(steps::install_linux_dependencies) - .add_step(steps::script("./script/bundle-linux")) - .add_step(steps::upload_artifact( - &artifact_name, - "target/release/zed-*.tar.gz", - )) - .add_step(steps::upload_artifact( - &remote_server_artifact_name, - "target/zed-remote-server-*.gz", - )) - .outputs( - [ - ("zed".to_string(), artifact_name), - ("remote-server".to_string(), remote_server_artifact_name), - ] - .into_iter() - .collect::>(), - ) + NamedJob { + name: format!("bundle_linux_{arch}"), + job: bundle_job(deps) + .runs_on(arch.linux_bundler()) + .envs(bundle_envs(platform)) + .add_step(steps::checkout_repo()) + .when_some(release_channel, |job, release_channel| { + job.add_step(set_release_channel(platform, release_channel)) + }) + .add_step(steps::setup_sentry()) + .map(steps::install_linux_dependencies) + .add_step(steps::script("./script/bundle-linux")) + .add_step(steps::upload_artifact( + &artifact_name, + "target/release/zed-*.tar.gz", + )) + .add_step(steps::upload_artifact( + &remote_server_artifact_name, + "target/zed-remote-server-*.gz", + )) + .outputs( + [ + ("zed".to_string(), artifact_name), + ("remote-server".to_string(), remote_server_artifact_name), + ] + .into_iter() + .collect::>(), + ), + } } -pub(crate) fn bundle_windows_job(arch: runners::Arch, deps: &[&NamedJob]) -> Job { +pub(crate) fn bundle_windows( + arch: runners::Arch, + release_channel: Option, + deps: &[&NamedJob], +) -> NamedJob { + let platform = Platform::Windows; + pub fn bundle_windows(arch: runners::Arch) -> Step { + let step = match arch { + runners::Arch::X86_64 => named::pwsh("script/bundle-windows.ps1 -Architecture x86_64"), + runners::Arch::AARCH64 => { + named::pwsh("script/bundle-windows.ps1 -Architecture aarch64") + } + }; + step.working_directory("${{ env.ZED_WORKSPACE }}") + } + use vars::GITHUB_SHA; let artifact_name = format!("Zed_{GITHUB_SHA}-{arch}.exe"); - bundle_job(deps) - .runs_on(runners::WINDOWS_DEFAULT) - .envs(windows_bundle_envs()) - .add_step(steps::checkout_repo()) - .add_step(steps::setup_sentry()) - .add_step(bundle_windows(arch)) - .add_step(steps::upload_artifact( - &artifact_name, - "${{ env.SETUP_PATH }}", - )) - .outputs( - [("zed".to_string(), artifact_name)] - .into_iter() - .collect::>(), - ) + NamedJob { + name: format!("bundle_windows_{arch}"), + job: bundle_job(deps) + .runs_on(runners::WINDOWS_DEFAULT) + .envs(bundle_envs(platform)) + .add_step(steps::checkout_repo()) + .when_some(release_channel, |job, release_channel| { + job.add_step(set_release_channel(platform, release_channel)) + }) + .add_step(steps::setup_sentry()) + .add_step(bundle_windows(arch)) + .add_step(steps::upload_artifact( + &artifact_name, + "${{ env.SETUP_PATH }}", + )) + .outputs( + [("zed".to_string(), artifact_name)] + .into_iter() + .collect::>(), + ), + } } -pub fn bundle_windows(arch: runners::Arch) -> Step { - let step = match arch { - runners::Arch::X86_64 => named::pwsh("script/bundle-windows.ps1 -Architecture x86_64"), - runners::Arch::ARM64 => named::pwsh("script/bundle-windows.ps1 -Architecture aarch64"), - }; - step.working_directory("${{ env.ZED_WORKSPACE }}") +fn set_release_channel(platform: Platform, release_channel: ReleaseChannel) -> Step { + match release_channel { + ReleaseChannel::Nightly => set_release_channel_to_nightly(platform), + } +} + +fn set_release_channel_to_nightly(platform: Platform) -> Step { + match platform { + Platform::Linux | Platform::Mac => named::bash(indoc::indoc! {r#" + set -eu + version=$(git rev-parse --short HEAD) + echo "Publishing version: ${version} on release channel nightly" + echo "nightly" > crates/zed/RELEASE_CHANNEL + "#}), + Platform::Windows => named::pwsh(indoc::indoc! {r#" + $ErrorActionPreference = "Stop" + $version = git rev-parse --short HEAD + Write-Host "Publishing version: $version on release channel nightly" + "nightly" | Set-Content -Path "crates/zed/RELEASE_CHANNEL" + "#}) + .working_directory("${{ env.ZED_WORKSPACE }}"), + } } diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rs index 88874754706661939490fc470c58d8a0c867c0d8..91cb3984b7d5e63c0235a25e0fd99611d2db3181 100644 --- a/tooling/xtask/src/tasks/workflows/run_tests.rs +++ b/tooling/xtask/src/tasks/workflows/run_tests.rs @@ -65,7 +65,7 @@ pub(crate) fn run_tests() -> Workflow { )), should_build_nix.guard(build_nix( Platform::Mac, - Arch::ARM64, + Arch::AARCH64, "debug", // *don't* cache the built output Some("-zed-editor-[0-9.]*-nightly"), @@ -74,7 +74,7 @@ pub(crate) fn run_tests() -> Workflow { ]; let tests_pass = tests_pass(&jobs); - let mut workflow = named::workflow() + named::workflow() .add_event(Event::default() .push( Push::default() @@ -89,11 +89,13 @@ pub(crate) fn run_tests() -> Workflow { ) .add_env(( "CARGO_TERM_COLOR", "always" )) .add_env(( "RUST_BACKTRACE", 1 )) - .add_env(( "CARGO_INCREMENTAL", 0 )); - for job in jobs { - workflow = workflow.add_job(job.name, job.job) - } - workflow.add_job(tests_pass.name, tests_pass.job) + .map(|mut workflow| { + for job in jobs { + workflow = workflow.add_job(job.name, job.job) + } + workflow + }) + .add_job(tests_pass.name, tests_pass.job) } // Generates a bash script that checks changed files against regex patterns diff --git a/tooling/xtask/src/tasks/workflows/runners.rs b/tooling/xtask/src/tasks/workflows/runners.rs index d001439b175789e709bd733f7660cc3200721d0a..010b9bee639c035143c415739a7e920ab89a7004 100644 --- a/tooling/xtask/src/tasks/workflows/runners.rs +++ b/tooling/xtask/src/tasks/workflows/runners.rs @@ -22,14 +22,14 @@ impl Into for Runner { #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum Arch { X86_64, - ARM64, + AARCH64, } impl std::fmt::Display for Arch { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Arch::X86_64 => write!(f, "x86_64"), - Arch::ARM64 => write!(f, "aarch64"), + Arch::AARCH64 => write!(f, "aarch64"), } } } @@ -38,14 +38,14 @@ impl Arch { pub fn triple(&self) -> &'static str { match self { Arch::X86_64 => "x86_64-unknown-linux-gnu", - Arch::ARM64 => "aarch64-unknown-linux-gnu", + Arch::AARCH64 => "aarch64-unknown-linux-gnu", } } pub fn linux_bundler(&self) -> Runner { match self { Arch::X86_64 => LINUX_X86_BUNDLER, - Arch::ARM64 => LINUX_ARM_BUNDLER, + Arch::AARCH64 => LINUX_ARM_BUNDLER, } } } @@ -66,3 +66,8 @@ impl std::fmt::Display for Platform { } } } + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum ReleaseChannel { + Nightly, +} diff --git a/tooling/xtask/src/tasks/workflows/vars.rs b/tooling/xtask/src/tasks/workflows/vars.rs index b852e12400098c3d49f806c0010458d123ad24fa..36aa4a4d84c5b197399c4abe489ecb100d2646f8 100644 --- a/tooling/xtask/src/tasks/workflows/vars.rs +++ b/tooling/xtask/src/tasks/workflows/vars.rs @@ -2,7 +2,7 @@ use std::cell::RefCell; use gh_workflow::{Concurrency, Env, Expression}; -use crate::tasks::workflows::steps::NamedJob; +use crate::tasks::workflows::{runners::Platform, steps::NamedJob}; macro_rules! secret { ($secret_name:ident) => { @@ -40,26 +40,31 @@ var!(AZURE_SIGNING_ENDPOINT); pub const GITHUB_SHA: &str = "${{ github.event.pull_request.head.sha || github.sha }}"; -pub fn mac_bundle_envs() -> Env { - Env::default() - .add("MACOS_CERTIFICATE", MACOS_CERTIFICATE) - .add("MACOS_CERTIFICATE_PASSWORD", MACOS_CERTIFICATE_PASSWORD) - .add("APPLE_NOTARIZATION_KEY", APPLE_NOTARIZATION_KEY) - .add("APPLE_NOTARIZATION_KEY_ID", APPLE_NOTARIZATION_KEY_ID) - .add("APPLE_NOTARIZATION_ISSUER_ID", APPLE_NOTARIZATION_ISSUER_ID) -} +pub fn bundle_envs(platform: Platform) -> Env { + let env = Env::default() + .add("CARGO_INCREMENTAL", 0) + .add("ZED_CLIENT_CHECKSUM_SEED", ZED_CLIENT_CHECKSUM_SEED) + .add("ZED_MINIDUMP_ENDPOINT", ZED_SENTRY_MINIDUMP_ENDPOINT); -pub fn windows_bundle_envs() -> Env { - Env::default() - .add("AZURE_TENANT_ID", AZURE_SIGNING_TENANT_ID) - .add("AZURE_CLIENT_ID", AZURE_SIGNING_CLIENT_ID) - .add("AZURE_CLIENT_SECRET", AZURE_SIGNING_CLIENT_SECRET) - .add("ACCOUNT_NAME", AZURE_SIGNING_ACCOUNT_NAME) - .add("CERT_PROFILE_NAME", AZURE_SIGNING_CERT_PROFILE_NAME) - .add("ENDPOINT", AZURE_SIGNING_ENDPOINT) - .add("FILE_DIGEST", "SHA256") - .add("TIMESTAMP_DIGEST", "SHA256") - .add("TIMESTAMP_SERVER", "http://timestamp.acs.microsoft.com") + match platform { + Platform::Linux => env, + Platform::Mac => env + .add("MACOS_CERTIFICATE", MACOS_CERTIFICATE) + .add("MACOS_CERTIFICATE_PASSWORD", MACOS_CERTIFICATE_PASSWORD) + .add("APPLE_NOTARIZATION_KEY", APPLE_NOTARIZATION_KEY) + .add("APPLE_NOTARIZATION_KEY_ID", APPLE_NOTARIZATION_KEY_ID) + .add("APPLE_NOTARIZATION_ISSUER_ID", APPLE_NOTARIZATION_ISSUER_ID), + Platform::Windows => env + .add("AZURE_TENANT_ID", AZURE_SIGNING_TENANT_ID) + .add("AZURE_CLIENT_ID", AZURE_SIGNING_CLIENT_ID) + .add("AZURE_CLIENT_SECRET", AZURE_SIGNING_CLIENT_SECRET) + .add("ACCOUNT_NAME", AZURE_SIGNING_ACCOUNT_NAME) + .add("CERT_PROFILE_NAME", AZURE_SIGNING_CERT_PROFILE_NAME) + .add("ENDPOINT", AZURE_SIGNING_ENDPOINT) + .add("FILE_DIGEST", "SHA256") + .add("TIMESTAMP_DIGEST", "SHA256") + .add("TIMESTAMP_SERVER", "http://timestamp.acs.microsoft.com"), + } } pub(crate) fn one_workflow_per_non_main_branch() -> Concurrency {