Skip to content

Commit abdbfcf

Browse files
committed
Add notarization for macOS artifacts, update workflow, and improve Homebrew Cask.
1 parent ec6f26a commit abdbfcf

File tree

2 files changed

+76
-21
lines changed

2 files changed

+76
-21
lines changed

.github/workflows/macos.yml

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,38 @@ jobs:
130130
--sign "Developer ID Installer: Ozkan Pakdil (${{ env.TEAM_ID }})" \
131131
SwaggerificInstaller.pkg
132132
133+
- name: Setup notarization credentials
134+
run: |
135+
mkdir -p ~/private_keys
136+
echo "${{ secrets.APPLE_API_KEY }}" | base64 --decode > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
137+
138+
- name: Notarize the application
139+
run: |
140+
echo "=== Creating zip for notarization ==="
141+
ditto -c -k --keepParent ./target/gluonfx/x86_64-darwin/${{ env.APP_NAME }}.app ${{ env.APP_NAME }}.zip
142+
143+
echo "=== Submitting app for notarization ==="
144+
xcrun notarytool submit ${{ env.APP_NAME }}.zip \
145+
--key ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8 \
146+
--key-id ${{ secrets.APPLE_API_KEY_ID }} \
147+
--issuer ${{ secrets.APPLE_API_ISSUER_ID }} \
148+
--wait
149+
150+
echo "=== Stapling notarization ticket to app ==="
151+
xcrun stapler staple ./target/gluonfx/x86_64-darwin/${{ env.APP_NAME }}.app
152+
153+
- name: Notarize the installer package
154+
run: |
155+
echo "=== Submitting pkg for notarization ==="
156+
xcrun notarytool submit SwaggerificInstaller.pkg \
157+
--key ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8 \
158+
--key-id ${{ secrets.APPLE_API_KEY_ID }} \
159+
--issuer ${{ secrets.APPLE_API_ISSUER_ID }} \
160+
--wait
161+
162+
echo "=== Stapling notarization ticket to pkg ==="
163+
xcrun stapler staple SwaggerificInstaller.pkg
164+
133165
- name: Prepare staging artifacts
134166
run: |
135167
cp -r ./target/gluonfx/x86_64-darwin/${{ env.APP_NAME }}.app staging/
@@ -150,7 +182,42 @@ jobs:
150182
repo_token: "${{ secrets.GITHUB_TOKEN }}"
151183
automatic_release_tag: "latest_macos"
152184
prerelease: true
153-
title: "MacOS Development Build (Signed)"
185+
title: "MacOS Development Build (Signed & Notarized)"
154186
files: |
155187
staging/*
156188
id: "automatic_releases"
189+
190+
- name: Update Homebrew Cask
191+
run: |
192+
# Calculate SHA256 of the tar.gz file
193+
SHA256=$(shasum -a 256 staging/swaggerific_x86_64-darwin.tar.gz | awk '{print $1}')
194+
echo "SHA256: $SHA256"
195+
196+
# Update the cask file with the new SHA256
197+
cat > Casks/swaggerific.rb << EOF
198+
cask "swaggerific" do
199+
version "${{ env.APP_VERSION }}"
200+
sha256 "$SHA256"
201+
202+
url "https://github.com/ozkanpakdil/swaggerific/releases/download/latest_macos/swaggerific_x86_64-darwin.tar.gz",
203+
verified: "github.com/ozkanpakdil/swaggerific"
204+
name "Swaggerific"
205+
desc "Simple GUI app for working with Swagger/OpenAPI"
206+
homepage "https://github.com/ozkanpakdil/swaggerific"
207+
208+
app "swaggerific.app"
209+
210+
caveats <<~EOS
211+
This app is signed and notarized with a Developer ID certificate.
212+
It should open without any Gatekeeper warnings.
213+
EOS
214+
end
215+
EOF
216+
217+
- name: Commit and push Homebrew Cask update
218+
run: |
219+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
220+
git config --local user.name "github-actions[bot]"
221+
git add Casks/swaggerific.rb
222+
git diff --staged --quiet || git commit -m "Update Homebrew cask SHA256 for version ${{ env.APP_VERSION }}"
223+
git push

README.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ You can download the latest version
1010
from [Github releases ![Download count of latest releases](https://img.shields.io/github/downloads/ozkanpakdil/swaggerific/latest/total.svg)](https://github.com/ozkanpakdil/swaggerific/releases)
1111
Follow [here](https://bsky.app/profile/swaggerific.bsky.social) for new releases.
1212

13-
## Install via Homebrew (macOS arm64)
13+
## Install via Homebrew (macOS)
1414

15-
Swaggerific is available as a Homebrew Cask for Apple Silicon (arm64) macOS.
15+
Swaggerific is available as a Homebrew Cask for macOS (Intel x86_64). The app is **signed and notarized** with an Apple Developer ID certificate.
1616

17-
1) Tap this repository explicitly by URL:
17+
1) Tap this repository:
1818

1919
```bash
2020
brew tap ozkanpakdil/swaggerific https://github.com/ozkanpakdil/swaggerific
2121
```
2222

23-
2) Install into your user Applications folder:
23+
2) Install the app:
2424

2525
```bash
26-
brew install --cask swaggerific --appdir=~/Applications
26+
brew install --cask swaggerific
2727
```
2828

29-
- Update to the latest build later:
29+
- Update to the latest build:
3030

3131
```bash
3232
brew upgrade --cask swaggerific
@@ -39,22 +39,10 @@ brew uninstall --cask swaggerific
3939
```
4040

4141
Notes:
42-
- This cask targets Apple Silicon (arm64) builds only.
42+
- This cask targets Intel (x86_64) macOS builds.
43+
- The app is signed and notarized, so it should open without Gatekeeper warnings.
4344
- It pulls the latest prebuilt app bundle from the `latest_macos` GitHub release.
4445

45-
Tip (Gatekeeper on unsigned apps): If you see a message like “swaggerific.app is damaged and can’t be opened”, that’s macOS Gatekeeper blocking a quarantined, unsigned app from a personal tap. You can either install without quarantine or remove the quarantine attribute after install:
46-
47-
```bash
48-
# Option A: install without quarantine
49-
brew uninstall --cask swaggerific
50-
brew install --cask --no-quarantine swaggerific --appdir=~/Applications
51-
52-
# Option B: keep install, remove quarantine from the app bundle
53-
xattr -dr com.apple.quarantine ~/Applications/swaggerific.app
54-
```
55-
56-
We plan to add signing/notarization later; for now this personal tap uses unsigned builds.
57-
5846
## Packaging artifacts
5947

6048
The macOS packaging script `build-macos-arm64.sh` places generated artifacts under the `staging/` directory (tar.gz, .pkg, and installer .pkg). The `staging/` folder is ignored by Git.

0 commit comments

Comments
 (0)