Store current release channel name in a file in the zed crate
This commit is contained in:
+22
-14
@@ -79,22 +79,30 @@ jobs:
|
||||
clean: false
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Check that tag version matches package version
|
||||
- name: Determine version and release channel
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
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"
|
||||
|
||||
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}"
|
||||
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
|
||||
|
||||
- name: Create app bundle
|
||||
run: script/bundle
|
||||
@@ -107,11 +115,11 @@ jobs:
|
||||
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') }}
|
||||
name: Upload app bundle to release
|
||||
if: ${{ github.env.RELEASE_CHANNEL }}
|
||||
with:
|
||||
draft: true
|
||||
prerelease: ${{ endsWith(github.ref, '-pre') }}
|
||||
prerelease: ${{ github.env.RELEASE_CHANNEL == 'preview' }}
|
||||
files: target/release/Zed.dmg
|
||||
overwrite: true
|
||||
body: ""
|
||||
|
||||
Reference in New Issue
Block a user