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
|
2022-03-02 16:30:00 +03:00
|
|
|
runs-on:
|
2022-03-02 16:41:40 +03:00
|
|
|
- self-hosted
|
|
|
|
- test
|
2022-02-04 18:57:39 +03:00
|
|
|
env:
|
|
|
|
RUSTFLAGS: -D warnings
|
2021-05-18 06:57:07 +03:00
|
|
|
steps:
|
|
|
|
- name: Install Rust
|
2022-07-13 20:32:37 +03:00
|
|
|
run: |
|
|
|
|
rustup set profile minimal
|
|
|
|
rustup update stable
|
|
|
|
rustup target add wasm32-wasi
|
2022-07-11 19:29:27 +03:00
|
|
|
|
2022-05-18 22:28:26 +03:00
|
|
|
- name: Install Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '16'
|
|
|
|
|
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
|
2022-10-24 15:28:58 +03:00
|
|
|
submodules: 'recursive'
|
2022-08-11 03:01:13 +03:00
|
|
|
|
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
|
2022-05-27 01:40:46 +03:00
|
|
|
|
|
|
|
- name: Build collab binaries
|
|
|
|
run: cargo build --bins --all-features
|
2021-04-29 00:04:22 +03:00
|
|
|
|
2021-05-18 01:18:31 +03:00
|
|
|
bundle:
|
|
|
|
name: Bundle app
|
2022-03-02 16:30:00 +03:00
|
|
|
runs-on:
|
2022-03-02 16:41:40 +03:00
|
|
|
- self-hosted
|
|
|
|
- bundle
|
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 }}
|
2022-10-21 02:27:55 +03:00
|
|
|
ZED_AMPLITUDE_API_KEY: ${{ secrets.ZED_AMPLITUDE_API_KEY }}
|
2022-10-19 21:53:48 +03:00
|
|
|
ZED_MIXPANEL_TOKEN: ${{ secrets.ZED_MIXPANEL_TOKEN }}
|
2021-05-18 01:18:31 +03:00
|
|
|
steps:
|
2022-07-13 20:32:37 +03:00
|
|
|
- name: Install Rust
|
|
|
|
run: |
|
|
|
|
rustup set profile minimal
|
|
|
|
rustup update stable
|
|
|
|
rustup target add aarch64-apple-darwin
|
|
|
|
rustup target add x86_64-apple-darwin
|
|
|
|
rustup target add wasm32-wasi
|
2021-05-18 03:07:39 +03:00
|
|
|
|
2022-03-02 16:58:24 +03:00
|
|
|
- name: Install Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
2022-03-02 17:00:01 +03:00
|
|
|
node-version: '16'
|
2022-03-02 16:58:24 +03:00
|
|
|
|
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-10-24 15:28:58 +03:00
|
|
|
submodules: 'recursive'
|
2022-02-21 19:28:55 +03:00
|
|
|
|
2022-10-26 00:24:20 +03:00
|
|
|
- name: Check that tag version matches package version
|
2022-02-14 19:17:48 +03:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
2022-10-26 00:24:20 +03:00
|
|
|
run: |
|
|
|
|
set -eu
|
|
|
|
crate_version=$(script/get-crate-version zed)
|
|
|
|
tag_version=$(echo $GITHUB_REF_NAME | sed -e 's/^v//' -e 's/-pre$//')
|
|
|
|
if [[ $tag_version != $crate_version ]]; then
|
|
|
|
echo "zed crate version $crate_version does not match git tag version $tag_version"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "Publishing zed version: $crate_version"
|
|
|
|
|
|
|
|
- name: Enable the preview channel
|
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-pre') }}
|
|
|
|
run: |
|
|
|
|
echo "ZED_PREVIEW_CHANNEL=1 >> $GITHUB_ENV
|
2021-05-18 01:48:03 +03:00
|
|
|
|
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
|
2022-02-21 20:04:29 +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
|
2022-10-26 00:24:20 +03:00
|
|
|
prerelease: ${{ endsWith(github.ref, '-pre') }}
|
2021-05-18 08:39:01 +03:00
|
|
|
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 }}
|