2021-04-02 21:43:30 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-06-25 01:02:08 +00:00
|
|
|
- main
|
2021-05-17 22:47:42 +00:00
|
|
|
tags:
|
|
|
|
- "v*"
|
2021-04-02 21:43:30 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "**"
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
CARGO_INCREMENTAL: 0
|
2021-05-19 12:24:23 +00:00
|
|
|
RUST_BACKTRACE: 1
|
2021-04-02 21:43:30 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-05-18 03:57:07 +00:00
|
|
|
tests:
|
|
|
|
name: Run tests
|
2022-03-02 13:30:00 +00:00
|
|
|
runs-on:
|
2022-03-02 13:41:40 +00:00
|
|
|
- self-hosted
|
|
|
|
- test
|
2022-02-04 15:57:39 +00:00
|
|
|
env:
|
|
|
|
RUSTFLAGS: -D warnings
|
2021-05-18 03:57:07 +00:00
|
|
|
steps:
|
|
|
|
- name: Install Rust
|
2022-07-13 17:32:37 +00:00
|
|
|
run: |
|
|
|
|
rustup set profile minimal
|
|
|
|
rustup update stable
|
|
|
|
rustup target add wasm32-wasi
|
2022-07-11 16:29:27 +00:00
|
|
|
|
2022-05-18 19:28:26 +00:00
|
|
|
- name: Install Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '16'
|
|
|
|
|
2021-05-18 03:57:07 +00:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
2021-05-18 04:46:33 +00:00
|
|
|
with:
|
|
|
|
clean: false
|
2022-10-24 12:28:58 +00:00
|
|
|
submodules: 'recursive'
|
2022-08-11 00:01:13 +00:00
|
|
|
|
2021-05-18 03:57:07 +00:00
|
|
|
- name: Run tests
|
2021-09-16 00:56:08 +00:00
|
|
|
run: cargo test --workspace --no-fail-fast
|
2022-05-26 22:40:46 +00:00
|
|
|
|
|
|
|
- name: Build collab binaries
|
|
|
|
run: cargo build --bins --all-features
|
2021-04-28 21:04:22 +00:00
|
|
|
|
2021-05-17 22:18:31 +00:00
|
|
|
bundle:
|
|
|
|
name: Bundle app
|
2022-03-02 13:30:00 +00:00
|
|
|
runs-on:
|
2022-03-02 13:41:40 +00:00
|
|
|
- self-hosted
|
|
|
|
- bundle
|
2021-09-11 04:07:20 +00:00
|
|
|
env:
|
|
|
|
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
|
|
|
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
|
2021-09-11 05:11:22 +00:00
|
|
|
APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }}
|
|
|
|
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
|
2022-10-20 23:27:55 +00:00
|
|
|
ZED_AMPLITUDE_API_KEY: ${{ secrets.ZED_AMPLITUDE_API_KEY }}
|
2022-10-19 18:53:48 +00:00
|
|
|
ZED_MIXPANEL_TOKEN: ${{ secrets.ZED_MIXPANEL_TOKEN }}
|
2021-05-17 22:18:31 +00:00
|
|
|
steps:
|
2022-07-13 17:32:37 +00: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 00:07:39 +00:00
|
|
|
|
2022-03-02 13:58:24 +00:00
|
|
|
- name: Install Node
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
2022-03-02 14:00:01 +00:00
|
|
|
node-version: '16'
|
2022-03-02 13:58:24 +00:00
|
|
|
|
2021-05-17 22:48:03 +00:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
2021-05-18 04:46:33 +00:00
|
|
|
with:
|
|
|
|
clean: false
|
2022-10-24 12:28:58 +00:00
|
|
|
submodules: 'recursive'
|
2022-02-21 16:28:55 +00:00
|
|
|
|
2022-10-26 17:32:30 +00:00
|
|
|
- name: Determine version and release channel
|
2022-02-14 16:17:48 +00:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
2022-10-25 21:24:20 +00:00
|
|
|
run: |
|
|
|
|
set -eu
|
2022-10-26 17:32:30 +00:00
|
|
|
|
|
|
|
version=$(script/get-crate-version zed)
|
|
|
|
channel=$(cat crates/zed/RELEASE_CHANNEL)
|
|
|
|
echo "Publishing version: ${version} on release channel ${channel}"
|
|
|
|
echo "RELEASE_CHANNEL=${channel}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
expected_tag_name=""
|
|
|
|
case ${channel} in
|
|
|
|
stable)
|
|
|
|
expected_tag_name="v${version}";;
|
|
|
|
preview)
|
|
|
|
expected_tag_name="v${version}-pre";;
|
|
|
|
*)
|
|
|
|
echo "can't publish a release on channel ${channel}"
|
|
|
|
exit 1;;
|
|
|
|
esac
|
|
|
|
if [[ $GITHUB_REFNAME != $expected_tag_name ]]; then
|
|
|
|
echo "invalid release tag ${GITHUB_REFNAME}. expected ${expected_tag_name}"
|
2022-10-25 21:24:20 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2021-05-17 22:48:03 +00:00
|
|
|
|
2021-05-17 22:18:31 +00:00
|
|
|
- name: Create app bundle
|
2021-05-17 23:57:50 +00:00
|
|
|
run: script/bundle
|
2021-05-17 22:18:31 +00:00
|
|
|
|
2021-06-25 01:02:08 +00:00
|
|
|
- name: Upload app bundle to workflow run if main branch
|
2021-05-17 22:18:31 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
2022-02-21 17:04:29 +00:00
|
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
2021-04-28 21:04:22 +00:00
|
|
|
with:
|
2021-04-28 21:42:42 +00:00
|
|
|
name: Zed.dmg
|
2021-05-04 23:18:14 +00:00
|
|
|
path: target/release/Zed.dmg
|
2021-05-17 22:18:31 +00:00
|
|
|
|
2021-05-18 05:39:01 +00:00
|
|
|
- uses: softprops/action-gh-release@v1
|
2022-10-26 17:32:30 +00:00
|
|
|
name: Upload app bundle to release
|
|
|
|
if: ${{ github.env.RELEASE_CHANNEL }}
|
2021-05-17 22:18:31 +00:00
|
|
|
with:
|
2021-05-18 05:39:01 +00:00
|
|
|
draft: true
|
2022-10-26 17:32:30 +00:00
|
|
|
prerelease: ${{ github.env.RELEASE_CHANNEL == 'preview' }}
|
2021-05-18 05:39:01 +00:00
|
|
|
files: target/release/Zed.dmg
|
2021-05-17 22:18:31 +00:00
|
|
|
overwrite: true
|
|
|
|
body: ""
|
2021-05-18 05:39:01 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|