Skip to content

Commit 8812430

Browse files
committed
Update version to 1.0.0 and improve release workflow for Homebrew tap
1 parent bb48cb0 commit 8812430

2 files changed

Lines changed: 30 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ jobs:
4848
VERSION="${GITHUB_REF_NAME#v}"
4949
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
5050
./scripts/release_update.sh "$VERSION"
51+
ZIP_FILE="build/release/OpenClip-v${VERSION}.zip"
52+
SHA256=$(shasum -a 256 "$ZIP_FILE" | awk '{print $1}')
53+
echo "sha256=$SHA256" >> "$GITHUB_OUTPUT"
54+
echo "Built OpenClip v$VERSION with SHA256: $SHA256"
5155
5256
- name: Create GitHub Release
5357
id: create_release
@@ -60,15 +64,32 @@ jobs:
6064
draft: false
6165
prerelease: ${{ contains(github.ref, '-') }}
6266
generate_release_notes: true
67+
overwrite: true
6368

6469
- name: Update Homebrew Tap
65-
uses: mislav/bump-homebrew-formula-action@v3
6670
if: "!contains(github.ref, '-')"
67-
with:
68-
formula-name: openclip
69-
formula-path: Casks/openclip.rb
70-
homebrew-tap: ganeshmshetty/homebrew-tap
71-
download-url: https://github.com/ganeshmshetty/openclip/releases/download/${{ github.ref_name }}/OpenClip-v${{ steps.build_package.outputs.version }}.zip
72-
commit-message: "openclip ${{ steps.build_package.outputs.version }}"
7371
env:
74-
COMMITTER_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN || secrets.HOMEBREW_TAP_TOKEN }}
72+
TOKEN: ${{ secrets.TAP_GITHUB_TOKEN || secrets.HOMEBREW_TAP_TOKEN || secrets.PAT }}
73+
VERSION: ${{ steps.build_package.outputs.version }}
74+
SHA256: ${{ steps.build_package.outputs.sha256 }}
75+
run: |
76+
if [ -z "$TOKEN" ]; then
77+
echo "::warning ::No TAP_GITHUB_TOKEN or HOMEBREW_TAP_TOKEN secret configured. Skipping Homebrew tap update."
78+
exit 0
79+
fi
80+
echo "==> Updating ganeshmshetty/homebrew-tap cask..."
81+
rm -rf /tmp/homebrew-tap
82+
git clone "https://x-access-token:${TOKEN}@github.com/ganeshmshetty/homebrew-tap.git" /tmp/homebrew-tap
83+
cd /tmp/homebrew-tap
84+
sed -i '' "s/version \".*\"/version \"${VERSION}\"/" Casks/openclip.rb
85+
sed -i '' "s/sha256 \".*\"/sha256 \"${SHA256}\"/" Casks/openclip.rb
86+
git config user.name "github-actions[bot]"
87+
git config user.email "github-actions[bot]@users.noreply.github.com"
88+
git add Casks/openclip.rb
89+
if git diff --staged --quiet; then
90+
echo "No changes to Casks/openclip.rb"
91+
else
92+
git commit -m "openclip ${VERSION}"
93+
git push origin master
94+
echo "Successfully updated ganeshmshetty/homebrew-tap Casks/openclip.rb to v${VERSION} (${SHA256})"
95+
fi

Sources/OpenClip/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
18+
<string>1.0.0</string>
1919
<key>CFBundleURLTypes</key>
2020
<array>
2121
<dict>

0 commit comments

Comments
 (0)