2021-04-03 00:43:30 +03:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-06-25 04:02:08 +03:00
|
|
|
- main
|
2021-05-18 01:47:42 +03:00
|
|
|
tags:
|
|
|
|
- "v*"
|
2021-04-03 00:43:30 +03:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "**"
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
CARGO_INCREMENTAL: 0
|
2021-05-19 15:24:23 +03:00
|
|
|
RUST_BACKTRACE: 1
|
2021-04-03 00:43:30 +03:00
|
|
|
|
|
|
|
jobs:
|
2021-05-18 06:57:07 +03:00
|
|
|
tests:
|
|
|
|
name: Run tests
|
|
|
|
runs-on: self-hosted
|
2022-02-04 18:57:39 +03:00
|
|
|
env:
|
|
|
|
RUSTFLAGS: -D warnings
|
2021-05-18 06:57:07 +03:00
|
|
|
steps:
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
profile: minimal
|
2021-04-03 00:43:30 +03:00
|
|
|
|
2021-05-18 06:57:07 +03:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
2021-05-18 07:46:33 +03:00
|
|
|
with:
|
|
|
|
clean: false
|
2021-05-18 01:48:03 +03:00
|
|
|
|
2021-10-25 12:02:35 +03:00
|
|
|
- name: Download rust-analyzer
|
|
|
|
run: |
|
|
|
|
script/download-rust-analyzer
|
|
|
|
echo "$PWD/vendor/bin" >> $GITHUB_PATH
|
|
|
|
|
2021-05-18 06:57:07 +03:00
|
|
|
- name: Run tests
|
2021-09-16 03:56:08 +03:00
|
|
|
run: cargo test --workspace --no-fail-fast
|
2021-04-29 00:04:22 +03:00
|
|
|
|
2021-05-18 01:18:31 +03:00
|
|
|
bundle:
|
|
|
|
name: Bundle app
|
|
|
|
runs-on: self-hosted
|
2021-09-11 07:07:20 +03:00
|
|
|
env:
|
|
|
|
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
|
|
|
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
2021-09-11 08:11:22 +03:00
|
|
|
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
|
|
|
|
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
|
2021-05-18 01:18:31 +03:00
|
|
|
steps:
|
2021-05-18 03:07:39 +03:00
|
|
|
- name: Install Rust x86_64-apple-darwin target
|
2021-05-18 01:18:31 +03:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
profile: minimal
|
|
|
|
|
2021-05-18 03:07:39 +03:00
|
|
|
- name: Install Rust aarch64-apple-darwin target
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
profile: minimal
|
|
|
|
|
2021-05-18 01:48:03 +03:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
2021-05-18 07:46:33 +03:00
|
|
|
with:
|
|
|
|
clean: false
|
2022-02-14 19:17:48 +03:00
|
|
|
|
|
|
|
- name: Validate version
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
|
|
run: script/validate-version
|
2021-05-18 01:48:03 +03:00
|
|
|
|
2021-10-25 12:02:35 +03:00
|
|
|
- name: Download rust-analyzer
|
|
|
|
run: script/download-rust-analyzer
|
|
|
|
|
2021-05-18 01:18:31 +03:00
|
|
|
- name: Create app bundle
|
2021-05-18 02:57:50 +03:00
|
|
|
run: script/bundle
|
2021-05-18 01:18:31 +03:00
|
|
|
|
2021-06-25 04:02:08 +03:00
|
|
|
- name: Upload app bundle to workflow run if main branch
|
2021-05-18 01:18:31 +03:00
|
|
|
uses: actions/upload-artifact@v2
|
2021-06-25 04:02:08 +03:00
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
2021-04-29 00:04:22 +03:00
|
|
|
with:
|
2021-04-29 00:42:42 +03:00
|
|
|
name: Zed.dmg
|
2021-05-05 02:18:14 +03:00
|
|
|
path: target/release/Zed.dmg
|
2021-05-18 01:18:31 +03:00
|
|
|
|
2021-05-18 08:39:01 +03:00
|
|
|
- uses: softprops/action-gh-release@v1
|
2021-06-25 04:02:08 +03:00
|
|
|
name: Upload app bundle to release if release tag
|
2021-05-18 06:33:08 +03:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
2021-05-18 01:18:31 +03:00
|
|
|
with:
|
2021-05-18 08:39:01 +03:00
|
|
|
draft: true
|
|
|
|
files: target/release/Zed.dmg
|
2021-05-18 01:18:31 +03:00
|
|
|
overwrite: true
|
|
|
|
body: ""
|
2021-05-18 08:39:01 +03:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|