ci.yml

 1name: CI
 2
 3on:
 4  push:
 5    branches:
 6      - master
 7    tags:
 8      - "v*"
 9  pull_request:
10    branches:
11      - "**"
12
13env:
14  CARGO_TERM_COLOR: always
15  CARGO_INCREMENTAL: 0
16  RUST_BACKTRACE: 1
17
18jobs:
19  tests:
20    name: Run tests
21    runs-on: self-hosted
22    steps:
23      - name: Install Rust
24        uses: actions-rs/toolchain@v1
25        with:
26          toolchain: stable
27          target: x86_64-apple-darwin
28          profile: minimal
29
30      - name: Checkout repo
31        uses: actions/checkout@v2
32        with:
33          clean: false
34
35      - name: Run tests
36        run: cargo test --no-fail-fast
37
38  bundle:
39    name: Bundle app
40    runs-on: self-hosted
41    steps:
42      - name: Install Rust x86_64-apple-darwin target
43        uses: actions-rs/toolchain@v1
44        with:
45          toolchain: stable
46          target: x86_64-apple-darwin
47          profile: minimal
48
49      - name: Install Rust aarch64-apple-darwin target
50        uses: actions-rs/toolchain@v1
51        with:
52          toolchain: stable
53          target: aarch64-apple-darwin
54          profile: minimal
55
56      - name: Checkout repo
57        uses: actions/checkout@v2
58        with:
59          clean: false
60
61      - name: Create app bundle
62        run: script/bundle
63
64      - name: Upload app bundle to workflow run
65        uses: actions/upload-artifact@v2
66        with:
67          name: Zed.dmg
68          path: target/release/Zed.dmg
69
70      - uses: softprops/action-gh-release@v1
71        name: Upload app bundle to release
72        if: ${{ startsWith(github.ref, 'refs/tags/v') }}
73        with:
74          draft: true
75          files: target/release/Zed.dmg
76          overwrite: true
77          body: ""
78        env:
79          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}