Skip to content

Commit 18b8daf

Browse files
committed
enhance release workflow with SHA256 computation for macOS DMGs
1 parent cb9beeb commit 18b8daf

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,17 @@ jobs:
130130
with:
131131
path: release-artifacts
132132

133+
- name: Compute SHA256 for macOS DMGs
134+
id: dmg_shas
135+
run: |
136+
set -euo pipefail
137+
VERSION="${{ needs.version-check.outputs.version }}"
138+
ARM_DMG="release-artifacts/release-macos/API Key Health Checker-${VERSION}-arm64.dmg"
139+
INTEL_DMG="release-artifacts/release-macos/API Key Health Checker-${VERSION}-x64.dmg"
140+
141+
echo "ARM_SHA=$(sha256sum "$ARM_DMG" | awk '{print $1}')" >> "$GITHUB_OUTPUT"
142+
echo "INTEL_SHA=$(sha256sum "$INTEL_DMG" | awk '{print $1}')" >> "$GITHUB_OUTPUT"
143+
133144
- name: Publish release
134145
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
135146
with:
@@ -144,3 +155,27 @@ jobs:
144155
release-artifacts/**/*.AppImage
145156
env:
146157
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
158+
159+
- name: Checkout Homebrew tap
160+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
161+
with:
162+
repository: nbox/homebrew-tap
163+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
164+
path: tap
165+
166+
- name: Update cask in tap repo
167+
run: |
168+
set -euo pipefail
169+
VERSION="${{ needs.version-check.outputs.version }}"
170+
ARM_SHA="${{ steps.dmg_shas.outputs.ARM_SHA }}"
171+
INTEL_SHA="${{ steps.dmg_shas.outputs.INTEL_SHA }}"
172+
CASK="tap/Casks/api-key-health-checker.rb"
173+
174+
perl -i -pe 's/^ version ".*"$/ version "'"$VERSION"'"/' "$CASK"
175+
perl -0777 -i -pe 's/sha256 arm:\s*".*?",\s*\n\s*intel:\s*".*?"/sha256 arm: "'"$ARM_SHA"'",\n intel: "'"$INTEL_SHA"'"/s' "$CASK"
176+
177+
git -C tap config user.name "github-actions[bot]"
178+
git -C tap config user.email "41898282+github-actions[bot]@users.noreply.github.com"
179+
git -C tap add Casks/api-key-health-checker.rb
180+
git -C tap commit -m "api-key-health-checker $VERSION" || exit 0
181+
git -C tap push

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api-key-health-checker",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Desktop app to validate API keys for OpenAI, Gemini, YouTube, and custom endpoints with batch checks, rate limits, and reports.",
55
"license": "BSD-3-Clause",
66
"author": "nbox (https://github.com/nbox)",
@@ -36,6 +36,7 @@
3636
"appId": "com.nbox",
3737
"productName": "API Key Health Checker",
3838
"mac": {
39+
"artifactName": "API Key Health Checker-${version}-${arch}.${ext}",
3940
"icon": "resources/icon.icns",
4041
"target": [
4142
{

0 commit comments

Comments
 (0)