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 }}
0 commit comments