From 92066fd4c16e8f86549221be1699846abd3f3038 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 19 Nov 2024 16:06:51 -0700 Subject: [PATCH] Use gh to edit release directly --- .github/workflows/ci.yml | 7 ++++--- script/create-draft-release | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 script/create-draft-release diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bed52955ad2f2..f22a8a518e5c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -244,6 +244,7 @@ jobs: # # 25 was chosen arbitrarily. fetch-depth: 25 + fetch-tags: true clean: false - name: Limit target directory size @@ -261,6 +262,9 @@ jobs: mkdir -p target/ # Ignore any errors that occur while drafting release notes to not fail the build. script/draft-release-notes "$RELEASE_VERSION" "$RELEASE_CHANNEL" > target/release-notes.md || true + script/create-draft-release target/release-notes.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Generate license file run: script/generate-licenses @@ -306,7 +310,6 @@ jobs: target/aarch64-apple-darwin/release/Zed-aarch64.dmg target/x86_64-apple-darwin/release/Zed-x86_64.dmg target/release/Zed.dmg - body_path: target/release-notes.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -353,7 +356,6 @@ jobs: files: | target/zed-remote-server-linux-x86_64.gz target/release/zed-linux-x86_64.tar.gz - body: "" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -400,6 +402,5 @@ jobs: files: | target/zed-remote-server-linux-aarch64.gz target/release/zed-linux-aarch64.tar.gz - body: "" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/script/create-draft-release b/script/create-draft-release new file mode 100755 index 0000000000000..e72c6d141c230 --- /dev/null +++ b/script/create-draft-release @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +preview="" +if [[ "$GITHUB_REF_NAME" == *"-pre" ]]; then + preview="-p" +fi + +gh release create -d "$GITHUB_REF_NAME" -F "$1" $preview