From 4f36ba3b1ed22fcf7dcc449a57593571a255caf0 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 14 May 2023 22:06:33 +0300 Subject: [PATCH 1/2] Add a job to build Zed images from current main The job triggers on every commit to `main` or every PR with `run-build-dmg` label and produces an install-ready *.dmg artifact attached to the corresponding CI run. --- .github/workflows/build_dmg.yml | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build_dmg.yml diff --git a/.github/workflows/build_dmg.yml b/.github/workflows/build_dmg.yml new file mode 100644 index 0000000000..6558790fae --- /dev/null +++ b/.github/workflows/build_dmg.yml @@ -0,0 +1,49 @@ +on: + push: + branches: + - main + pull_request: + +defaults: + run: + shell: bash -euxo pipefail {0} + +concurrency: + # Allow only one workflow per any non-`main` branch. + group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }} + cancel-in-progress: true + +env: + RUST_BACKTRACE: 1 + COPT: '-Werror' + +jobs: + build-dmg: + if: github.ref_name == 'main' || contains(github.event.pull_request.labels.*.name, 'run-build-dmg') + env: + SHA: ${{ github.event.pull_request.head.sha || github.sha }} + runs-on: + - self-hosted + - test + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + clean: false + submodules: 'recursive' + + - name: Install Rust + run: | + rustup set profile minimal + rustup update stable + + + - name: Build dmg bundle + run: ./script/bundle + + - name: Upload the build stats + uses: actions/upload-artifact@v3 + with: + name: zed-main-$SHA.dmg + path: ./target/release/Zed.dmg From 5465948f200b55dd4dca0a2afeb1045ef9be359b Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 14 May 2023 22:09:28 +0300 Subject: [PATCH 2/2] Build Zed dmg --- .github/workflows/build_dmg.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_dmg.yml b/.github/workflows/build_dmg.yml index 6558790fae..989914e5e8 100644 --- a/.github/workflows/build_dmg.yml +++ b/.github/workflows/build_dmg.yml @@ -1,7 +1,10 @@ +name: Build Zed.dmg + on: push: branches: - main + - "v[0-9]+.[0-9]+.x" pull_request: defaults: @@ -20,8 +23,6 @@ env: jobs: build-dmg: if: github.ref_name == 'main' || contains(github.event.pull_request.labels.*.name, 'run-build-dmg') - env: - SHA: ${{ github.event.pull_request.head.sha || github.sha }} runs-on: - self-hosted - test @@ -38,12 +39,16 @@ jobs: rustup set profile minimal rustup update stable + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: 18 - name: Build dmg bundle run: ./script/bundle - - name: Upload the build stats + - name: Upload the build artifact uses: actions/upload-artifact@v3 with: - name: zed-main-$SHA.dmg + name: Zed_${{ github.event.pull_request.head.sha || github.sha }}.dmg path: ./target/release/Zed.dmg