From 2a5f59d53d76dd442074577d7a3fa3dd235c7d2c Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Sun, 2 Nov 2025 22:25:40 -0700 Subject: [PATCH] Name assets correctly on upload This simplifies the mental map you need to maintain to understand which assets end up where --- .github/workflows/release.yml | 80 +++++++++---------- .github/workflows/release_nightly.yml | 80 +++++++++---------- .github/workflows/run_bundling.yml | 60 +++++++------- tooling/xtask/src/tasks/workflows/release.rs | 45 ++--------- .../src/tasks/workflows/release_nightly.rs | 2 +- .../xtask/src/tasks/workflows/run_bundling.rs | 68 +++++++++------- tooling/xtask/src/tasks/workflows/runners.rs | 7 -- tooling/xtask/src/tasks/workflows/vars.rs | 32 +++++++- 8 files changed, 186 insertions(+), 188 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ff7fb400be95372b2cb3bfef87f5dee731e2bf4..e5de40c89ec57bd73b6717b88bf566c902841b7c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -201,21 +201,21 @@ jobs: - 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' + - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + name: zed-linux-aarch64.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' + - name: '@actions/upload-artifact zed-remote-server-linux-aarch64.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 + name: zed-remote-server-linux-aarch64.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 + zed: zed-linux-aarch64.tar.gz + remote-server: zed-remote-server-linux-aarch64.gz timeout-minutes: 60 bundle_linux_x86_64: needs: @@ -244,21 +244,21 @@ jobs: - 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' + - name: '@actions/upload-artifact zed-linux-x86_64.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 + name: zed-linux-x86_64.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' + - name: '@actions/upload-artifact zed-remote-server-linux-x86_64.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 + name: zed-remote-server-linux-x86_64.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 + zed: zed-linux-x86_64.tar.gz + remote-server: zed-remote-server-linux-x86_64.gz timeout-minutes: 60 bundle_mac_aarch64: needs: @@ -293,21 +293,21 @@ jobs: - 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' + - name: '@actions/upload-artifact Zed-aarch64.dmg' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.dmg + name: Zed-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' + - name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-aarch64.gz + name: zed-remote-server-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 + zed: Zed-aarch64.dmg + remote-server: zed-remote-server-macos-aarch64.gz timeout-minutes: 60 bundle_mac_x86_64: needs: @@ -342,21 +342,21 @@ jobs: - 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' + - name: '@actions/upload-artifact Zed-x86_64.dmg' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg + name: Zed-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' + - name: '@actions/upload-artifact zed-remote-server-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 + name: zed-remote-server-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 + zed: Zed-x86_64.dmg + remote-server: zed-remote-server-macos-x86_64.gz timeout-minutes: 60 bundle_windows_aarch64: needs: @@ -389,14 +389,14 @@ jobs: 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' + - name: '@actions/upload-artifact Zed-aarch64.exe' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe + name: Zed-aarch64.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-aarch64.exe timeout-minutes: 60 bundle_windows_x86_64: needs: @@ -429,14 +429,14 @@ jobs: 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' + - name: '@actions/upload-artifact Zed-x86_64.exe' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe + name: Zed-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 + zed: Zed-x86_64.exe timeout-minutes: 60 upload_release_assets: needs: @@ -460,16 +460,16 @@ jobs: 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 + mv ./artifacts/Zed-aarch64.dmg/Zed-aarch64.dmg release-artifacts/Zed-aarch64.dmg + mv ./artifacts/Zed-x86_64.dmg/Zed-x86_64.dmg release-artifacts/Zed-x86_64.dmg + mv ./artifacts/zed-linux-aarch64.tar.gz/zed-linux-aarch64.tar.gz release-artifacts/zed-linux-aarch64.tar.gz + mv ./artifacts/zed-linux-x86_64.tar.gz/zed-linux-x86_64.tar.gz release-artifacts/zed-linux-x86_64.tar.gz + mv ./artifacts/Zed-x86_64.exe/Zed-x86_64.exe release-artifacts/Zed-x86_64.exe + mv ./artifacts/Zed-aarch64.exe/Zed-aarch64.exe release-artifacts/Zed-aarch64.exe + mv ./artifacts/zed-remote-server-macos-aarch64.gz/zed-remote-server-macos-aarch64.gz release-artifacts/zed-remote-server-macos-aarch64.gz + mv ./artifacts/zed-remote-server-macos-x86_64.gz/zed-remote-server-macos-x86_64.gz release-artifacts/zed-remote-server-macos-x86_64.gz + mv ./artifacts/zed-remote-server-linux-aarch64.gz/zed-remote-server-linux-aarch64.gz release-artifacts/zed-remote-server-linux-aarch64.gz + mv ./artifacts/zed-remote-server-linux-x86_64.gz/zed-remote-server-linux-x86_64.gz release-artifacts/zed-remote-server-linux-x86_64.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 278793c7ea8a2a6fc38e92a1eb32b37f113d07db..f06216a9d6e0be0ff43353ae9e6a5cbcee6f8882 100644 --- a/.github/workflows/release_nightly.yml +++ b/.github/workflows/release_nightly.yml @@ -96,21 +96,21 @@ jobs: - 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' + - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + name: zed-linux-aarch64.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' + - name: '@actions/upload-artifact zed-remote-server-linux-aarch64.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 + name: zed-remote-server-linux-aarch64.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 + zed: zed-linux-aarch64.tar.gz + remote-server: zed-remote-server-linux-aarch64.gz timeout-minutes: 60 bundle_linux_x86_64: needs: @@ -146,21 +146,21 @@ jobs: - 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' + - name: '@actions/upload-artifact zed-linux-x86_64.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 + name: zed-linux-x86_64.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' + - name: '@actions/upload-artifact zed-remote-server-linux-x86_64.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 + name: zed-remote-server-linux-x86_64.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 + zed: zed-linux-x86_64.tar.gz + remote-server: zed-remote-server-linux-x86_64.gz timeout-minutes: 60 bundle_mac_aarch64: needs: @@ -202,21 +202,21 @@ jobs: - 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' + - name: '@actions/upload-artifact Zed-aarch64.dmg' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.dmg + name: Zed-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' + - name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-aarch64.gz + name: zed-remote-server-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 + zed: Zed-aarch64.dmg + remote-server: zed-remote-server-macos-aarch64.gz timeout-minutes: 60 bundle_mac_x86_64: needs: @@ -258,21 +258,21 @@ jobs: - 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' + - name: '@actions/upload-artifact Zed-x86_64.dmg' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg + name: Zed-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' + - name: '@actions/upload-artifact zed-remote-server-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 + name: zed-remote-server-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 + zed: Zed-x86_64.dmg + remote-server: zed-remote-server-macos-x86_64.gz timeout-minutes: 60 bundle_windows_aarch64: needs: @@ -313,14 +313,14 @@ jobs: 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' + - name: '@actions/upload-artifact Zed-aarch64.exe' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe + name: Zed-aarch64.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-aarch64.exe timeout-minutes: 60 bundle_windows_x86_64: needs: @@ -361,14 +361,14 @@ jobs: 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' + - name: '@actions/upload-artifact Zed-x86_64.exe' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe + name: Zed-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 + zed: Zed-x86_64.exe timeout-minutes: 60 build_nix_linux_x86_64: needs: @@ -466,16 +466,16 @@ jobs: 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 + mv ./artifacts/Zed-aarch64.dmg/Zed-aarch64.dmg release-artifacts/Zed-aarch64.dmg + mv ./artifacts/Zed-x86_64.dmg/Zed-x86_64.dmg release-artifacts/Zed-x86_64.dmg + mv ./artifacts/zed-linux-aarch64.tar.gz/zed-linux-aarch64.tar.gz release-artifacts/zed-linux-aarch64.tar.gz + mv ./artifacts/zed-linux-x86_64.tar.gz/zed-linux-x86_64.tar.gz release-artifacts/zed-linux-x86_64.tar.gz + mv ./artifacts/Zed-x86_64.exe/Zed-x86_64.exe release-artifacts/Zed-x86_64.exe + mv ./artifacts/Zed-aarch64.exe/Zed-aarch64.exe release-artifacts/Zed-aarch64.exe + mv ./artifacts/zed-remote-server-macos-aarch64.gz/zed-remote-server-macos-aarch64.gz release-artifacts/zed-remote-server-macos-aarch64.gz + mv ./artifacts/zed-remote-server-macos-x86_64.gz/zed-remote-server-macos-x86_64.gz release-artifacts/zed-remote-server-macos-x86_64.gz + mv ./artifacts/zed-remote-server-linux-aarch64.gz/zed-remote-server-linux-aarch64.gz release-artifacts/zed-remote-server-linux-aarch64.gz + mv ./artifacts/zed-remote-server-linux-x86_64.gz/zed-remote-server-linux-x86_64.gz release-artifacts/zed-remote-server-linux-x86_64.gz shell: bash -euxo pipefail {0} - name: ./script/upload-nightly run: ./script/upload-nightly diff --git a/.github/workflows/run_bundling.yml b/.github/workflows/run_bundling.yml index 8379913d647fbb020088762da8577c569d9cd9ac..2dc318b84f7c24fa778c31e8665d33cc2f6bd146 100644 --- a/.github/workflows/run_bundling.yml +++ b/.github/workflows/run_bundling.yml @@ -37,21 +37,21 @@ jobs: - 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' + - name: '@actions/upload-artifact zed-linux-aarch64.tar.gz' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz + name: zed-linux-aarch64.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' + - name: '@actions/upload-artifact zed-remote-server-linux-aarch64.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 + name: zed-remote-server-linux-aarch64.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 + zed: zed-linux-aarch64.tar.gz + remote-server: zed-remote-server-linux-aarch64.gz timeout-minutes: 60 bundle_linux_x86_64: if: |- @@ -80,21 +80,21 @@ jobs: - 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' + - name: '@actions/upload-artifact zed-linux-x86_64.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 + name: zed-linux-x86_64.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' + - name: '@actions/upload-artifact zed-remote-server-linux-x86_64.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 + name: zed-remote-server-linux-x86_64.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 + zed: zed-linux-x86_64.tar.gz + remote-server: zed-remote-server-linux-x86_64.gz timeout-minutes: 60 bundle_mac_aarch64: if: |- @@ -129,21 +129,21 @@ jobs: - 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' + - name: '@actions/upload-artifact Zed-aarch64.dmg' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.dmg + name: Zed-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' + - name: '@actions/upload-artifact zed-remote-server-macos-aarch64.gz' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: zed-remote-server-${{ github.event.pull_request.head.sha || github.sha }}-macos-aarch64.gz + name: zed-remote-server-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 + zed: Zed-aarch64.dmg + remote-server: zed-remote-server-macos-aarch64.gz timeout-minutes: 60 bundle_mac_x86_64: if: |- @@ -178,21 +178,21 @@ jobs: - 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' + - name: '@actions/upload-artifact Zed-x86_64.dmg' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.dmg + name: Zed-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' + - name: '@actions/upload-artifact zed-remote-server-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 + name: zed-remote-server-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 + zed: Zed-x86_64.dmg + remote-server: zed-remote-server-macos-x86_64.gz timeout-minutes: 60 bundle_windows_aarch64: if: |- @@ -225,14 +225,14 @@ jobs: 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' + - name: '@actions/upload-artifact Zed-aarch64.exe' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-aarch64.exe + name: Zed-aarch64.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-aarch64.exe timeout-minutes: 60 bundle_windows_x86_64: if: |- @@ -265,14 +265,14 @@ jobs: 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' + - name: '@actions/upload-artifact Zed-x86_64.exe' uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 with: - name: Zed_${{ github.event.pull_request.head.sha || github.sha }}-x86_64.exe + name: Zed-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 + zed: Zed-x86_64.exe timeout-minutes: 60 concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} diff --git a/tooling/xtask/src/tasks/workflows/release.rs b/tooling/xtask/src/tasks/workflows/release.rs index f25626e4351f5b69bbe0535ceb6927e09a929a3f..95af92030e4d3de537ef1a44eb48d3643990ef72 100644 --- a/tooling/xtask/src/tasks/workflows/release.rs +++ b/tooling/xtask/src/tasks/workflows/release.rs @@ -5,7 +5,7 @@ use crate::tasks::workflows::{ run_tests, runners::{self, Arch}, steps::{self, FluentBuilder, NamedJob, dependant_job, named, release_job}, - vars, + vars::{self, assets}, }; pub(crate) fn release() -> Workflow { @@ -124,45 +124,10 @@ pub(crate) fn download_workflow_artifacts() -> Step { .add_with(("path", "./artifacts/")) } -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", - ), - ]; - +pub(crate) fn prep_release_artifacts() -> Step { 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}"); + for asset in assets::all() { + let mv_command = format!("mv ./artifacts/{asset}/{asset} release-artifacts/{asset}"); script_lines.push(mv_command) } @@ -178,7 +143,7 @@ fn upload_release_assets(deps: &[&NamedJob], bundle: &ReleaseBundleJobs) -> Name .runs_on(runners::LINUX_MEDIUM) .add_step(download_workflow_artifacts()) .add_step(steps::script("ls -lR ./artifacts")) - .add_step(prep_release_artifacts(bundle)) + .add_step(prep_release_artifacts()) .add_step( steps::script("gh release upload \"$GITHUB_REF_NAME\" --repo=zed-industries/zed release-artifacts/*") .add_env(("GITHUB_TOKEN", "${{ secrets.GITHUB_TOKEN }}")), diff --git a/tooling/xtask/src/tasks/workflows/release_nightly.rs b/tooling/xtask/src/tasks/workflows/release_nightly.rs index ce352eedf0d8f4f86864a68ab365836b571dc36a..f99bce63eb5429febd9ab2c97f3edbb072f51613 100644 --- a/tooling/xtask/src/tasks/workflows/release_nightly.rs +++ b/tooling/xtask/src/tasks/workflows/release_nightly.rs @@ -122,7 +122,7 @@ fn update_nightly_tag_job(bundle: &ReleaseBundleJobs) -> NamedJob { .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(prep_release_artifacts()) .add_step( steps::script("./script/upload-nightly") .add_env(( diff --git a/tooling/xtask/src/tasks/workflows/run_bundling.rs b/tooling/xtask/src/tasks/workflows/run_bundling.rs index ed7f7b39b24788b662ed834e7fbcd9191895f322..055faf78dbda3706ffe16983d2843d4eeb5d9a90 100644 --- a/tooling/xtask/src/tasks/workflows/run_bundling.rs +++ b/tooling/xtask/src/tasks/workflows/run_bundling.rs @@ -2,10 +2,10 @@ use crate::tasks::workflows::{ release::ReleaseBundleJobs, runners::{Arch, Platform, ReleaseChannel}, steps::{FluentBuilder, NamedJob, dependant_job, named}, - vars::bundle_envs, + vars::{assets, bundle_envs}, }; -use super::{runners, steps, vars}; +use super::{runners, steps}; use gh_workflow::*; use indexmap::IndexMap; @@ -49,17 +49,22 @@ fn bundle_job(deps: &[&NamedJob]) -> Job { } pub(crate) fn bundle_mac( - arch: runners::Arch, + arch: Arch, release_channel: Option, deps: &[&NamedJob], ) -> NamedJob { - pub fn bundle_mac(arch: runners::Arch) -> Step { + pub fn bundle_mac(arch: 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"); + let artifact_name = match arch { + Arch::X86_64 => assets::MAC_X86_64, + Arch::AARCH64 => assets::MAC_AARCH64, + }; + let remote_server_artifact_name = match arch { + Arch::X86_64 => assets::REMOTE_SERVER_MAC_X86_64, + Arch::AARCH64 => assets::REMOTE_SERVER_MAC_AARCH64, + }; NamedJob { name: format!("bundle_mac_{arch}"), job: bundle_job(deps) @@ -83,8 +88,11 @@ pub(crate) fn bundle_mac( )) .outputs( [ - ("zed".to_string(), artifact_name), - ("remote-server".to_string(), remote_server_artifact_name), + ("zed".to_string(), artifact_name.to_string()), + ( + "remote-server".to_string(), + remote_server_artifact_name.to_string(), + ), ] .into_iter() .collect::>(), @@ -93,17 +101,19 @@ pub(crate) fn bundle_mac( } pub(crate) fn bundle_linux( - arch: runners::Arch, + arch: 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() - ); + let artifact_name = match arch { + Arch::X86_64 => assets::LINUX_X86_64, + Arch::AARCH64 => assets::LINUX_AARCH64, + }; + let remote_server_artifact_name = match arch { + Arch::X86_64 => assets::REMOTE_SERVER_LINUX_X86_64, + Arch::AARCH64 => assets::REMOTE_SERVER_LINUX_AARCH64, + }; NamedJob { name: format!("bundle_linux_{arch}"), job: bundle_job(deps) @@ -126,8 +136,11 @@ pub(crate) fn bundle_linux( )) .outputs( [ - ("zed".to_string(), artifact_name), - ("remote-server".to_string(), remote_server_artifact_name), + ("zed".to_string(), artifact_name.to_string()), + ( + "remote-server".to_string(), + remote_server_artifact_name.to_string(), + ), ] .into_iter() .collect::>(), @@ -136,23 +149,22 @@ pub(crate) fn bundle_linux( } pub(crate) fn bundle_windows( - arch: runners::Arch, + arch: Arch, release_channel: Option, deps: &[&NamedJob], ) -> NamedJob { let platform = Platform::Windows; - pub fn bundle_windows(arch: runners::Arch) -> Step { + pub fn bundle_windows(arch: 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") - } + Arch::X86_64 => named::pwsh("script/bundle-windows.ps1 -Architecture x86_64"), + 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"); + let artifact_name = match arch { + Arch::X86_64 => assets::WINDOWS_X86_64, + Arch::AARCH64 => assets::WINDOWS_AARCH64, + }; NamedJob { name: format!("bundle_windows_{arch}"), job: bundle_job(deps) @@ -169,7 +181,7 @@ pub(crate) fn bundle_windows( "${{ env.SETUP_PATH }}", )) .outputs( - [("zed".to_string(), artifact_name)] + [("zed".to_string(), artifact_name.to_string())] .into_iter() .collect::>(), ), diff --git a/tooling/xtask/src/tasks/workflows/runners.rs b/tooling/xtask/src/tasks/workflows/runners.rs index 010b9bee639c035143c415739a7e920ab89a7004..df98826f8afb7dccb3f9e268fe427634caec8dba 100644 --- a/tooling/xtask/src/tasks/workflows/runners.rs +++ b/tooling/xtask/src/tasks/workflows/runners.rs @@ -35,13 +35,6 @@ impl std::fmt::Display for Arch { } impl Arch { - pub fn triple(&self) -> &'static str { - match self { - Arch::X86_64 => "x86_64-unknown-linux-gnu", - Arch::AARCH64 => "aarch64-unknown-linux-gnu", - } - } - pub fn linux_bundler(&self) -> Runner { match self { Arch::X86_64 => LINUX_X86_BUNDLER, diff --git a/tooling/xtask/src/tasks/workflows/vars.rs b/tooling/xtask/src/tasks/workflows/vars.rs index 36aa4a4d84c5b197399c4abe489ecb100d2646f8..f64d883cf8337131a83d944ea0f744becc6832a7 100644 --- a/tooling/xtask/src/tasks/workflows/vars.rs +++ b/tooling/xtask/src/tasks/workflows/vars.rs @@ -38,8 +38,6 @@ var!(AZURE_SIGNING_ACCOUNT_NAME); var!(AZURE_SIGNING_CERT_PROFILE_NAME); var!(AZURE_SIGNING_ENDPOINT); -pub const GITHUB_SHA: &str = "${{ github.event.pull_request.head.sha || github.sha }}"; - pub fn bundle_envs(platform: Platform) -> Env { let env = Env::default() .add("CARGO_INCREMENTAL", 0) @@ -115,3 +113,33 @@ impl PathCondition { } } } + +pub mod assets { + // NOTE: these asset names also exist in the zed.dev codebase. + pub const MAC_AARCH64: &str = "Zed-aarch64.dmg"; + pub const MAC_X86_64: &str = "Zed-x86_64.dmg"; + pub const LINUX_AARCH64: &str = "zed-linux-aarch64.tar.gz"; + pub const LINUX_X86_64: &str = "zed-linux-x86_64.tar.gz"; + pub const WINDOWS_X86_64: &str = "Zed-x86_64.exe"; + pub const WINDOWS_AARCH64: &str = "Zed-aarch64.exe"; + + pub const REMOTE_SERVER_MAC_AARCH64: &str = "zed-remote-server-macos-aarch64.gz"; + pub const REMOTE_SERVER_MAC_X86_64: &str = "zed-remote-server-macos-x86_64.gz"; + pub const REMOTE_SERVER_LINUX_AARCH64: &str = "zed-remote-server-linux-aarch64.gz"; + pub const REMOTE_SERVER_LINUX_X86_64: &str = "zed-remote-server-linux-x86_64.gz"; + + pub fn all() -> Vec<&'static str> { + vec![ + MAC_AARCH64, + MAC_X86_64, + LINUX_AARCH64, + LINUX_X86_64, + WINDOWS_X86_64, + WINDOWS_AARCH64, + REMOTE_SERVER_MAC_AARCH64, + REMOTE_SERVER_MAC_X86_64, + REMOTE_SERVER_LINUX_AARCH64, + REMOTE_SERVER_LINUX_X86_64, + ] + } +}