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
17jobs:
18  tests:
19    name: Run tests
20    runs-on: self-hosted
21    steps:
22      - name: Install Rust
23        uses: actions-rs/toolchain@v1
24        with:
25          toolchain: stable
26          target: x86_64-apple-darwin
27          profile: minimal
28
29      - name: Checkout repo
30        uses: actions/checkout@v2
31
32      - name: Run tests
33        run: cargo test --no-fail-fast
34
35  bundle:
36    name: Bundle app
37    runs-on: self-hosted
38    steps:
39      - name: Install Rust x86_64-apple-darwin target
40        uses: actions-rs/toolchain@v1
41        with:
42          toolchain: stable
43          target: x86_64-apple-darwin
44          profile: minimal
45
46      - name: Install Rust aarch64-apple-darwin target
47        uses: actions-rs/toolchain@v1
48        with:
49          toolchain: stable
50          target: aarch64-apple-darwin
51          profile: minimal
52
53      - name: Checkout repo
54        uses: actions/checkout@v2
55
56      - name: Create app bundle
57        run: script/bundle
58
59      - name: Upload app bundle to workflow run
60        uses: actions/upload-artifact@v2
61        with:
62          name: Zed.dmg
63          path: target/release/Zed.dmg
64
65      - uses: svenstaro/upload-release-action@v2
66        name: Upload app bundle to release
67        if: ${{ startsWith(github.ref, 'refs/tags/v') }}
68        with:
69          repo_token: ${{ secrets.GITHUB_TOKEN }}
70          file: target/release/Zed.dmg
71          asset_name: Zed.dmg
72          tag: ${{ github.ref }}
73          overwrite: true
74          body: ""