mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
59ed535cdf
When bundled, we will retrieve it out of the `Resources` folder. Locally, we're expected to run `script/download-rust-analyzer` and put `vendor/bin` in our $PATH.
94 lines
2.3 KiB
YAML
94 lines
2.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- "v*"
|
|
pull_request:
|
|
branches:
|
|
- "**"
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
CARGO_INCREMENTAL: 0
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
tests:
|
|
name: Run tests
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: x86_64-apple-darwin
|
|
profile: minimal
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v2
|
|
with:
|
|
clean: false
|
|
|
|
- name: Download rust-analyzer
|
|
run: |
|
|
script/download-rust-analyzer
|
|
echo "$PWD/vendor/bin" >> $GITHUB_PATH
|
|
|
|
- name: Run tests
|
|
run: cargo test --workspace --no-fail-fast
|
|
|
|
bundle:
|
|
name: Bundle app
|
|
runs-on: self-hosted
|
|
env:
|
|
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
|
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
|
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
|
|
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
|
|
steps:
|
|
- name: Install Rust x86_64-apple-darwin target
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: x86_64-apple-darwin
|
|
profile: minimal
|
|
|
|
- name: Install Rust aarch64-apple-darwin target
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
target: aarch64-apple-darwin
|
|
profile: minimal
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v2
|
|
with:
|
|
clean: false
|
|
|
|
- name: Download rust-analyzer
|
|
run: script/download-rust-analyzer
|
|
|
|
- name: Create app bundle
|
|
run: script/bundle
|
|
|
|
- name: Upload app bundle to workflow run if main branch
|
|
uses: actions/upload-artifact@v2
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
with:
|
|
name: Zed.dmg
|
|
path: target/release/Zed.dmg
|
|
|
|
- uses: softprops/action-gh-release@v1
|
|
name: Upload app bundle to release if release tag
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
|
with:
|
|
draft: true
|
|
files: target/release/Zed.dmg
|
|
overwrite: true
|
|
body: ""
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|