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      - uses: actions/cache@v2
40
41      - name: Install Rust x86_64-apple-darwin target
42        uses: actions-rs/toolchain@v1
43        with:
44          toolchain: stable
45          target: x86_64-apple-darwin
46          profile: minimal
47
48      - name: Install Rust aarch64-apple-darwin target
49        uses: actions-rs/toolchain@v1
50        with:
51          toolchain: stable
52          target: aarch64-apple-darwin
53          profile: minimal
54
55      - name: Checkout repo
56        uses: actions/checkout@v2
57
58      - name: Create app bundle
59        run: script/bundle
60
61      - name: Upload app bundle to workflow run
62        uses: actions/upload-artifact@v2
63        with:
64          name: Zed.dmg
65          path: target/release/Zed.dmg
66
67      - uses: svenstaro/upload-release-action@v2
68        name: Upload app bundle to release
69        if: ${{ startsWith(github.github.ref, 'refs/tags/v') }}
70        with:
71          repo_token: ${{ secrets.GITHUB_TOKEN }}
72          file: target/release/Zed.dmg
73          asset_name: Zed.dmg
74          tag: ${{ github.ref }}
75          overwrite: true
76          body: ""