From 4f8caedf94bb68bc7f269314a66501ce8ce40fc6 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 16:18:31 -0600 Subject: [PATCH 01/13] Add a release upload action --- .github/workflows/ci.yml | 50 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5929f7912..f77f79bba6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ env: jobs: tests: - name: Tests + name: Run tests runs-on: self-hosted steps: - name: Checkout repo @@ -47,9 +47,53 @@ jobs: - name: Run tests run: cargo test --no-fail-fast - - name: Create and upload app bundle + bundle: + name: Bundle app + runs-on: self-hosted + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + # Work around https://github.com/actions/cache/issues/403. + - name: Use GNU tar + run: | + echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV + + - name: Cache artifacts + id: cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + ~/.rustup + target + key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + + - name: Install Rust + if: steps.cache.outputs.cache-hit != 'true' + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-apple-darwin + profile: minimal + + - name: Create app bundle run: script/bundle - - uses: actions/upload-artifact@v2 + + - name: Upload app bundle to workflow run + uses: actions/upload-artifact@v2 with: name: Zed.dmg path: target/release/Zed.dmg + + - uses: svenstaro/upload-release-action@v2 + name: Upload app bundle to release + if: ${{ startsWith(github.github.ref, 'refs/tags/v') }} + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: target/release/Zed.dmg + asset_name: Zed.dmg + tag: ${{ github.ref }} + overwrite: true + body: "" From 28988fcbb596938663000876adfffbadd15d3d1b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 16:47:42 -0600 Subject: [PATCH 02/13] Run CI on tag pushes --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f77f79bba6..e8d62b432b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,8 @@ on: push: branches: - master + tags: + - "v*" pull_request: branches: - "**" From 4a3f3be40d6d3155f44ccc7143930f433076fca3 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 16:48:03 -0600 Subject: [PATCH 03/13] Can we skip caching because we're self hosted? --- .github/workflows/ci.yml | 46 ++++++---------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8d62b432b..dd854f1dae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,33 +19,16 @@ jobs: name: Run tests runs-on: self-hosted steps: - - name: Checkout repo - uses: actions/checkout@v2 - - # Work around https://github.com/actions/cache/issues/403. - - name: Use GNU tar - run: | - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - - - name: Cache artifacts - id: cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ~/.rustup - target - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - - name: Install Rust - if: steps.cache.outputs.cache-hit != 'true' uses: actions-rs/toolchain@v1 with: toolchain: stable target: x86_64-apple-darwin profile: minimal + - name: Checkout repo + uses: actions/checkout@v2 + - name: Run tests run: cargo test --no-fail-fast @@ -53,33 +36,16 @@ jobs: name: Bundle app runs-on: self-hosted steps: - - name: Checkout repo - uses: actions/checkout@v2 - - # Work around https://github.com/actions/cache/issues/403. - - name: Use GNU tar - run: | - echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV - - - name: Cache artifacts - id: cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ~/.rustup - target - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} - - name: Install Rust - if: steps.cache.outputs.cache-hit != 'true' uses: actions-rs/toolchain@v1 with: toolchain: stable target: x86_64-apple-darwin profile: minimal + - name: Checkout repo + uses: actions/checkout@v2 + - name: Create app bundle run: script/bundle From 667aa947e655acd810a405667ca14bb8cb5121a9 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 17:51:06 -0600 Subject: [PATCH 04/13] Will you work please? --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd854f1dae..3452cb6a30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v2 - name: Create app bundle - run: script/bundle + run: bash ./script/bundle - name: Upload app bundle to workflow run uses: actions/upload-artifact@v2 From 08c7a499e50a02b0d99afdf69f60f0ded1255b3e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 17:51:48 -0600 Subject: [PATCH 05/13] Focus on bundling --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3452cb6a30..cc1cef936d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,22 +15,22 @@ env: CARGO_INCREMENTAL: 0 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 + # 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 + # - name: Checkout repo + # uses: actions/checkout@v2 - - name: Run tests - run: cargo test --no-fail-fast + # - name: Run tests + # run: cargo test --no-fail-fast bundle: name: Bundle app From 7f2da31708268bb90ad26a8ef63f0fd6380fd6e5 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 17:57:50 -0600 Subject: [PATCH 06/13] Install cargo-bundle if needed in script/bundle --- .github/workflows/ci.yml | 2 +- script/bundle | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc1cef936d..4fee8acf5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: uses: actions/checkout@v2 - name: Create app bundle - run: bash ./script/bundle + run: script/bundle - name: Upload app bundle to workflow run uses: actions/upload-artifact@v2 diff --git a/script/bundle b/script/bundle index 197bc7821c..8c8475e01b 100755 --- a/script/bundle +++ b/script/bundle @@ -2,6 +2,9 @@ set -e +# Install cargo-bundle 0.5.0 if it's not already installed +cargo install cargo-bundle --version 0.5.0 + # Build the app bundle for x86_64 pushd zed > /dev/null cargo bundle --release --target x86_64-apple-darwin From 693a96f0e53080129f442f43d19fcf2027d85754 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 18:07:39 -0600 Subject: [PATCH 07/13] Explicitly install aarch64 target --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4fee8acf5a..c47cde02b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,13 +36,23 @@ jobs: name: Bundle app runs-on: self-hosted steps: - - name: Install Rust + - 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: Install cargo bundle + run: cargo install cargo-bundle + - name: Checkout repo uses: actions/checkout@v2 From 642912388195ba04c479754819d05a750e013a17 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 18:09:35 -0600 Subject: [PATCH 08/13] Remove unnecessary step --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c47cde02b6..9da6c78647 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,9 +50,6 @@ jobs: target: aarch64-apple-darwin profile: minimal - - name: Install cargo bundle - run: cargo install cargo-bundle - - name: Checkout repo uses: actions/checkout@v2 From e8985b46ddf7d883ac024930accf7e5aa899b55b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 20:55:42 -0600 Subject: [PATCH 09/13] Does this make job setup faster? --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9da6c78647..2b07b1acf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,8 @@ jobs: name: Bundle app runs-on: self-hosted steps: + - uses: actions/cache@v2 + - name: Install Rust x86_64-apple-darwin target uses: actions-rs/toolchain@v1 with: From f6bb550fb16d3090c42a73faf9b856b97a3e534e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 20:58:03 -0600 Subject: [PATCH 10/13] Revert "Does this make job setup faster?" This reverts commit e8985b46ddf7d883ac024930accf7e5aa899b55b. --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b07b1acf7..9da6c78647 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,8 +36,6 @@ jobs: name: Bundle app runs-on: self-hosted steps: - - uses: actions/cache@v2 - - name: Install Rust x86_64-apple-darwin target uses: actions-rs/toolchain@v1 with: From 614d74948c3e2e9de7ac71c0e697934617f70725 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 21:33:08 -0600 Subject: [PATCH 11/13] =?UTF-8?q?=F0=9F=A4=A6=E2=80=8D=E2=99=82=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9da6c78647..4541d78b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: - uses: svenstaro/upload-release-action@v2 name: Upload app bundle to release - if: ${{ startsWith(github.github.ref, 'refs/tags/v') }} + if: ${{ startsWith(github.ref, 'refs/tags/v') }} with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: target/release/Zed.dmg From f7e8e21d74348ba12ea2f842cc6a357d76df3611 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 21:57:07 -0600 Subject: [PATCH 12/13] Reenable tests --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4541d78b99..da5d631e1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,22 +15,22 @@ env: CARGO_INCREMENTAL: 0 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 + 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 + - name: Checkout repo + uses: actions/checkout@v2 - # - name: Run tests - # run: cargo test --no-fail-fast + - name: Run tests + run: cargo test --no-fail-fast bundle: name: Bundle app From aef21e1c0bf50cbe9c14b2918c48cd68540baac7 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 17 May 2021 22:46:33 -0600 Subject: [PATCH 13/13] Try not cleaning on checkout --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da5d631e1e..5369935567 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,8 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 + with: + clean: false - name: Run tests run: cargo test --no-fail-fast @@ -52,6 +54,8 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 + with: + clean: false - name: Create app bundle run: script/bundle