build_dmg.yml

 1name: Build Zed.dmg
 2
 3on:
 4  push:
 5    branches:
 6    - main
 7    - "v[0-9]+.[0-9]+.x"
 8  pull_request:
 9
10defaults:
11  run:
12    shell: bash -euxo pipefail {0}
13
14concurrency:
15  # Allow only one workflow per any non-`main` branch.
16  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
17  cancel-in-progress: true
18
19env:
20  RUST_BACKTRACE: 1
21  COPT: '-Werror'
22
23jobs:
24  build-dmg:
25    if: github.ref_name == 'main' || contains(github.event.pull_request.labels.*.name, 'run-build-dmg')
26    runs-on:
27      - self-hosted
28      - test
29    steps:
30      - name: Checkout
31        uses: actions/checkout@v3
32        with:
33          fetch-depth: 0
34          clean: false
35          submodules: 'recursive'
36
37      - name: Install Rust
38        run: |
39          rustup set profile minimal
40          rustup update stable
41
42      - name: Install node
43        uses: actions/setup-node@v3
44        with:
45          node-version: 18
46
47      - name: Build dmg bundle
48        run: ./script/bundle
49
50      - name: Upload the build artifact
51        uses: actions/upload-artifact@v3
52        with:
53          name: Zed_${{ github.event.pull_request.head.sha || github.sha }}.dmg
54          path: ./target/release/Zed.dmg