Skip to content

Commit 4855d03

Browse files
authored
ci: move cask (#47)
1 parent 8a1bad8 commit 4855d03

File tree

3 files changed

+49
-21
lines changed

3 files changed

+49
-21
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ jobs:
3030
with:
3131
fetch-depth: 0 # Full history for changelog generation
3232

33+
- name: Configure git user
34+
run: |
35+
git config --global user.name "github-actions[bot]"
36+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
37+
3338
- name: Select Xcode version
3439
run: sudo xcode-select -s /Applications/Xcode_26.2.app/Contents/Developer
3540

@@ -245,8 +250,7 @@ jobs:
245250
246251
### Homebrew (recommended)
247252
\`\`\`bash
248-
brew tap sozercan/kaset https://github.com/sozercan/kaset
249-
brew install --cask kaset
253+
brew install sozercan/repo/kaset
250254
\`\`\`
251255
252256
### Manual Download
@@ -303,28 +307,32 @@ jobs:
303307
$PRERELEASE_FLAG
304308
fi
305309
306-
- name: Commit Cask and Appcast Update
307-
run: |
308-
git config user.name "github-actions[bot]"
309-
git config user.email "github-actions[bot]@users.noreply.github.com"
310-
311-
# Fetch and checkout the default branch (we're in detached HEAD from tag checkout)
312-
git fetch origin ${{ github.event.repository.default_branch }}
313-
git checkout ${{ github.event.repository.default_branch }}
310+
- name: Checkout Homebrew tap repo
311+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v4
312+
with:
313+
repository: sozercan/homebrew-repo
314+
token: ${{ secrets.HOMEBREW_REPO_TOKEN }}
315+
path: homebrew-repo
316+
fetch-depth: 0
314317

315-
# Re-apply the cask update on the branch
318+
- name: Update Homebrew Cask
319+
run: |
316320
TAG="${{ steps.artifact.outputs.tag }}"
317321
VERSION="${TAG#v}"
318322
323+
cd homebrew-repo
324+
325+
# Update the cask file
326+
mkdir -p Casks
319327
cat > Casks/kaset.rb << EOF
320328
cask "kaset" do
321329
version "$VERSION"
322330
sha256 "${{ steps.sha256.outputs.sha256 }}"
323331
324-
url "https://github.com/${{ github.repository }}/releases/download/v#{version}/kaset-v#{version}.dmg"
332+
url "https://github.com/sozercan/kaset/releases/download/v#{version}/kaset-v#{version}.dmg"
325333
name "Kaset"
326334
desc "Native YouTube Music client"
327-
homepage "https://github.com/${{ github.repository }}"
335+
homepage "https://github.com/sozercan/kaset"
328336
329337
auto_updates true
330338
depends_on macos: ">= :tahoe"
@@ -345,10 +353,23 @@ jobs:
345353
end
346354
EOF
347355
356+
git add Casks/kaset.rb
357+
git diff --cached --quiet || git commit -m "Update kaset to ${TAG}"
358+
git push origin main
359+
360+
- name: Update Appcast
361+
run: |
362+
# Fetch and checkout the default branch (we're in detached HEAD from tag checkout)
363+
git fetch origin ${{ github.event.repository.default_branch }}
364+
git checkout ${{ github.event.repository.default_branch }}
365+
366+
TAG="${{ steps.artifact.outputs.tag }}"
367+
VERSION="${TAG#v}"
368+
348369
# Update appcast.xml for Sparkle auto-updates
349370
SIGNATURE="${{ steps.sparkle_sign.outputs.signature }}"
350371
LENGTH="${{ steps.sparkle_sign.outputs.length }}"
351-
372+
352373
if [ -n "$SIGNATURE" ]; then
353374
PUB_DATE=$(date -u "+%a, %d %b %Y %H:%M:%S %z")
354375
DOWNLOAD_URL="https://github.com/${{ github.repository }}/releases/download/${TAG}/${{ steps.artifact.outputs.filename }}"
@@ -381,10 +402,8 @@ jobs:
381402
</channel>
382403
</rss>
383404
APPCAST_EOF
384-
405+
385406
git add appcast.xml
407+
git diff --cached --quiet || git commit -m "Update appcast to ${{ steps.artifact.outputs.tag }}"
408+
git push origin ${{ github.event.repository.default_branch }}
386409
fi
387-
388-
git add Casks/kaset.rb
389-
git diff --cached --quiet || git commit -m "Update cask and appcast to ${{ steps.artifact.outputs.tag }}"
390-
git push origin ${{ github.event.repository.default_branch }}

Casks/kaset.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,21 @@
77
desc "Native YouTube Music client"
88
homepage "https://github.com/sozercan/kaset"
99

10+
deprecate! date: "2026-01-06", because: "has moved to a new tap"
11+
1012
auto_updates false
1113
depends_on macos: ">= :tahoe"
1214

1315
app "Kaset.app"
1416

17+
caveats <<~EOS
18+
⚠️ This tap is deprecated and will no longer receive updates.
19+
20+
To migrate to the new tap:
21+
brew untap sozercan/kaset
22+
brew install sozercan/repo/kaset
23+
EOS
24+
1525
postflight do
1626
system_command "/usr/bin/xattr", args: ["-cr", "#{appdir}/Kaset.app"], sudo: false
1727
end

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Download the latest release from the [Releases](https://github.com/sozercan/kase
3737
### Homebrew
3838

3939
```bash
40-
brew tap sozercan/kaset https://github.com/sozercan/kaset
41-
brew install --cask kaset
40+
brew install sozercan/repo/kaset
4241
```
4342

4443
> **Note:** The app is not signed.

0 commit comments

Comments
 (0)