update: Updated naming for bump files, added kdeconnect

This commit is contained in:
Darwin Cereska
2025-06-19 19:20:30 -04:00
parent 072d845a7b
commit 7ca0543429
4 changed files with 95 additions and 4 deletions

91
.github/workflows/bump-kdeconnect.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: Bump kdeconnect Cask
on:
schedule:
- cron: "0 * * * *" # every hour
workflow_dispatch:
permissions:
contents: write
jobs:
update-cask:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: sudo apt update && sudo apt install -y curl grep sed coreutils
- name: Fetch latest build
id: fetch
run: |
URL="https://cdn.kde.org/ci-builds/network/kdeconnect-kde/master/macos-arm64/"
echo "Fetching from: $URL"
# Fetch and parse the latest build
latest=$(curl -s "$URL" | grep -o 'kdeconnect-kde-master-[0-9]\+-macos-clang-arm64\.dmg' | sort -V | tail -n1)
if [ -z "$latest" ]; then
echo "Error: No DMG files found"
exit 1
fi
echo "Latest file found: $latest"
version=$(echo "$latest" | sed -n 's/.*kdeconnect-kde-master-\([0-9]\+\)-.*/\1/p')
if [ -z "$version" ]; then
echo "Error: Could not extract version number"
exit 1
fi
full_url="${URL}${latest}"
echo "Version: $version"
echo "URL: $full_url"
# Set outputs safely
{
echo "version=${version}"
echo "url=${full_url}"
} >> "${GITHUB_OUTPUT:-/dev/null}"
- name: Download .dmg and calculate SHA256
id: hash
run: |
url="${{ steps.fetch.outputs.url }}"
echo "Downloading from: $url"
if ! curl -L "$url" -o kdeconnect.dmg; then
echo "Error: Failed to download DMG file"
exit 1
fi
if [ ! -f kdeconnect.dmg ]; then
echo "Error: DMG file not found after download"
exit 1
fi
sha256=$(sha256sum kdeconnect.dmg | awk '{print $1}')
echo "SHA256: $sha256"
# Set output safely
echo "sha256=$sha256" >> "${GITHUB_OUTPUT:-/dev/null}"
- name: Update Cask file
run: |
sed -i "s/^ version \".*\"/ version \"${{ steps.fetch.outputs.version }}\"/" Casks/kdeconnect-nightly.rb
sed -i "s/^ sha256 \".*\"/ sha256 \"${{ steps.hash.outputs.sha256 }}\"/" Casks/kdeconnect-nightly.rb
- name: Commit and push if changed
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add Casks/kdeconnect-nightly.rb
if ! git diff --cached --quiet; then
git commit -m "bump: Update kdeconnect to build ${{ steps.fetch.outputs.version }}"
git push
else
echo "No changes to commit"
fi

View File

@@ -56,7 +56,7 @@ jobs:
git add Formula/ttymer.rb
if ! git diff --cached --quiet; then
VERSION=${{ steps.fetch.outputs.version }}
git commit -m "Auto-update ttymer to $VERSION"
git commit -m "bump: Updated ttymer to $VERSION"
git push
else
echo "No changes to commit"

View File

@@ -56,7 +56,7 @@ jobs:
git add Formula/xswitcher.rb
if ! git diff --cached --quiet; then
VERSION=${{ steps.fetch.outputs.version }}
git commit -m "Auto-update xswitcher to $VERSION"
git commit -m "bump: Updated xswitcher to $VERSION"
git push
else
echo "No changes to commit"

View File

@@ -1,6 +1,6 @@
cask "kdeconnect" do
version "5118"
sha256 "4e835a05cac6b7a1935ac41100690f0c5ab2f2ca35c6f159e3568d319717fc2b"
version ""
sha256 ""
url "https://cdn.kde.org/ci-builds/network/kdeconnect-kde/master/macos-arm64/kdeconnect-kde-master-#{version}-macos-clang-arm64.dmg",
verified: "cdn.kde.org"