Skip to content

Commit 7ce483c

Browse files
committed
remove preview cask updating
1 parent b4d8a1f commit 7ce483c

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
update-cask:
109109
name: Update homebrew-coder cask
110110
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest'}}
111-
if: ${{ github.repository_owner == 'coder' && !inputs.dryrun }}
111+
if: ${{ github.repository_owner == 'coder' && github.event_name == 'release' }}
112112
needs: build
113113
steps:
114114
- name: Checkout
@@ -124,7 +124,7 @@ jobs:
124124
- name: Update homebrew-coder
125125
env:
126126
GH_TOKEN: ${{ secrets.CODERCI_GITHUB_TOKEN }}
127-
RELEASE_TAG: ${{ github.event_name == 'release' && github.event.release.tag_name || 'preview' }}
127+
RELEASE_TAG: ${{ github.event.release.tag_name }}
128128
ASSIGNEE: ${{ github.actor }}
129129
run: |
130130
git config --global user.email "ci@coder.com"

scripts/update-cask.sh

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ done
3939
echo "Error: VERSION cannot be empty"
4040
exit 1
4141
}
42-
[[ "$VERSION" =~ ^v || "$VERSION" == "preview" ]] || {
42+
[[ "$VERSION" =~ ^v ]] || {
4343
echo "Error: VERSION must start with a 'v'"
4444
exit 1
4545
}
@@ -54,12 +54,6 @@ gh release download "$VERSION" \
5454

5555
HASH=$(shasum -a 256 "$GH_RELEASE_FOLDER"/Coder-Desktop.pkg | awk '{print $1}' | tr -d '\n')
5656

57-
IS_PREVIEW=false
58-
if [[ "$VERSION" == "preview" ]]; then
59-
IS_PREVIEW=true
60-
VERSION=$(make 'print-CURRENT_PROJECT_VERSION' | sed 's/CURRENT_PROJECT_VERSION=//g')
61-
fi
62-
6357
# Check out the homebrew tap repo
6458
TAP_CHECHOUT_FOLDER=$(mktemp -d)
6559

@@ -72,38 +66,27 @@ BREW_BRANCH="auto-release/desktop-$VERSION"
7266
# Check if a PR already exists.
7367
# Continue on a main branch release, as the sha256 will change.
7468
pr_count="$(gh pr list --search "head:$BREW_BRANCH" --json id,closed | jq -r ".[] | select(.closed == false) | .id" | wc -l)"
75-
if [[ "$pr_count" -gt 0 && "$IS_PREVIEW" == false ]]; then
69+
if [[ "$pr_count" -gt 0 ]]; then
7670
echo "Bailing out as PR already exists" 2>&1
7771
exit 0
7872
fi
7973

8074
git checkout -b "$BREW_BRANCH"
8175

82-
# If this is a main branch build, append a preview suffix to the cask.
83-
SUFFIX=""
84-
CONFLICTS_WITH="coder-desktop-preview"
85-
TAG=$VERSION
86-
if [[ "$IS_PREVIEW" == true ]]; then
87-
SUFFIX="-preview"
88-
CONFLICTS_WITH="coder-desktop"
89-
TAG="preview"
90-
fi
91-
9276
mkdir -p "$TAP_CHECHOUT_FOLDER"/Casks
9377

9478
# Overwrite the cask file
95-
cat >"$TAP_CHECHOUT_FOLDER"/Casks/coder-desktop${SUFFIX}.rb <<EOF
96-
cask "coder-desktop${SUFFIX}" do
79+
cat >"$TAP_CHECHOUT_FOLDER"/Casks/coder-desktop.rb <<EOF
80+
cask "coder-desktop" do
9781
version "${VERSION#v}"
98-
sha256 $([ "$IS_PREVIEW" = true ] && echo ":no_check" || echo "\"${HASH}\"")
82+
sha256 "${HASH}"
9983
100-
url "https://github.com/coder/coder-desktop-macos/releases/download/$([ "$IS_PREVIEW" = true ] && echo "${TAG}" || echo "v#{version}")/Coder-Desktop.pkg"
84+
url "https://github.com/coder/coder-desktop-macos/releases/download/v#{version}/Coder-Desktop.pkg"
10185
name "Coder Desktop"
10286
desc "Native desktop client for Coder"
10387
homepage "https://github.com/coder/coder-desktop-macos"
10488
auto_updates true
10589
106-
conflicts_with cask: "coder/coder/${CONFLICTS_WITH}"
10790
depends_on macos: ">= :sonoma"
10891
10992
pkg "Coder-Desktop.pkg"

0 commit comments

Comments
 (0)