Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions .github/workflows/publish.yml

This file was deleted.

122 changes: 122 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Release (macOS)

# Manual trigger: Actions tab → "Release (macOS)" → Run workflow.
# Mirrors the Pear release flow (date-based version, Developer ID signing +
# notarization, stable-named DMG, publish-to-draft-then-flip-live).
on:
workflow_dispatch:

permissions:
contents: write # create the GitHub Release

jobs:
release:
runs-on: macos-14
timeout-minutes: 60 # backstop for the notarization retry loop below
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Compute date-based version
id: version
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
YEAR="$(date +%Y)"
# 10# forces base-10 so "08"/"09" aren't read as invalid octal, and
# drops the leading zero to stay valid semver (2026.6.1, not 2026.06.1).
MONTH="$((10#$(date +%m)))"
# Count this month's releases (drafts included) so re-running before
# publishing a draft doesn't reuse its version.
COUNT="$(gh api --paginate "repos/${GITHUB_REPOSITORY}/releases" \
--jq '.[].tag_name' | grep -Ec "^v${YEAR}\.${MONTH}\." || true)"
N="$((COUNT + 1))"
VERSION="${YEAR}.${MONTH}.${N}"
echo "Release #${N} for ${YEAR}-$(date +%m) -> v${VERSION}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"

- name: Generate changelog
id: changelog
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="${{ steps.version.outputs.tag }}"
PREVIOUS_TAG="$(git tag --sort=-version:refname | grep -E '^v[0-9]' | grep -v "^${TAG}$" | head -n 1 || true)"
NOTES_FILE="${RUNNER_TEMP}/release-notes.md"
args=(-f "tag_name=${TAG}" -f "target_commitish=${GITHUB_SHA}")
if [ -n "${PREVIOUS_TAG}" ]; then
args+=(-f "previous_tag_name=${PREVIOUS_TAG}")
fi
gh api "repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
"${args[@]}" --jq ".body" > "${NOTES_FILE}"
echo "notes_file=${NOTES_FILE}" >> "$GITHUB_OUTPUT"

- name: Decode App Store Connect API key (.p8)
env:
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
run: |
mkdir -p "$HOME/private_keys"
echo "$APPLE_API_KEY_BASE64" | base64 --decode > "$HOME/private_keys/AuthKey.p8"
echo "APPLE_API_KEY=$HOME/private_keys/AuthKey.p8" >> "$GITHUB_ENV"

- name: Import Developer ID certificate
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
run: |
KEYCHAIN="$RUNNER_TEMP/app-signing.keychain-db"
KCPW="$(uuidgen)" # throwaway keychain password, never persisted
echo "$CSC_LINK" | base64 --decode > "$RUNNER_TEMP/certificate.p12"
security create-keychain -p "$KCPW" "$KEYCHAIN"
security set-keychain-settings -lut 21600 "$KEYCHAIN"
security unlock-keychain -p "$KCPW" "$KEYCHAIN"
security import "$RUNNER_TEMP/certificate.p12" -k "$KEYCHAIN" \
-P "$CSC_KEY_PASSWORD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple: \
-s -k "$KCPW" "$KEYCHAIN"
security list-keychains -d user -s "$KEYCHAIN" \
$(security list-keychains -d user | sed s/\"//g)

- name: Build, sign, notarize & package
env:
VERSION: ${{ steps.version.outputs.version }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
# notarytool can hit transient Apple notary drops; retry the whole
# build a few times. Notarization runs before publishing, so a failed
# attempt leaves nothing half-published.
run: |
for attempt in 1 2 3; do
if ./release.sh; then exit 0; fi
echo "release attempt ${attempt} failed; retrying in 60s..."
sleep 60
done
echo "release failed after 3 attempts"
exit 1

- name: Publish GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload assets to a draft first (atomic), then flip it live and mark it
# latest — what makes releases/latest/download/AgentLimit-arm64.dmg work.
run: |
TAG="${{ steps.version.outputs.tag }}"
gh release create "${TAG}" dist/AgentLimit-arm64.dmg \
--repo "${GITHUB_REPOSITORY}" \
--target "${GITHUB_SHA}" \
--title "${{ steps.version.outputs.version }}" \
--notes-file "${{ steps.changelog.outputs.notes_file }}" \
--draft
gh release edit "${TAG}" --repo "${GITHUB_REPOSITORY}" --draft=false --latest

- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: agentlimit-macos-${{ github.run_id }}
path: dist/*.dmg
if-no-files-found: warn
retention-days: 30
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
node_modules/
dist/
.DS_Store
*.log
bun.lockb
.npm-cache
.build/
dist/
*.xcodeproj
*.xcworkspace
.swiftpm/
node_modules/
.npm-cache/
17 changes: 0 additions & 17 deletions AGENTS.md

This file was deleted.

Binary file added App/AppIcon.icns
Binary file not shown.
30 changes: 30 additions & 0 deletions App/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>AgentLimit</string>
<key>CFBundleDisplayName</key>
<string>Agent Limit</string>
<key>CFBundleExecutable</key>
<string>AgentLimit</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>com.agentworkforce.agentlimit</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>13.0</string>
<key>LSUIElement</key>
<true/>
Comment on lines +23 to +24

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add an in-app quit affordance

With LSUIElement enabled, macOS hides the app from the Dock and normal app menu, and the new MenuBarExtra content does not provide any Quit/NSApp.terminate action. Anyone who launches the installed background app therefore has no UI path to stop it other than killing it from Activity Monitor or the terminal, so keep a quit item somewhere in the menu bar UI before shipping this mode.

Useful? React with 👍 / 👎.

<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSHumanReadableCopyright</key>
<string>MIT License</string>
</dict>
</plist>
120 changes: 0 additions & 120 deletions CHANGELOG.md

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Will Washburn

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading