Skip to content

AF flag update

AF flag update #13

name: Build and Release macOS App
on:
push:
tags:
- 'v*' # Triggers on version tags like v1.0.0
workflow_dispatch: # Allows manual triggering
permissions:
contents: write
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Import Code-Signing Certificates
uses: Apple-Actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Build app
run: |
xcodebuild -project MultiTimeInMenuBar.xcodeproj \
-scheme MultiTimeInMenuBar \
-configuration Release \
-derivedDataPath build/ \
-archivePath build/MultiTimeInMenuBar.xcarchive \
archive \
CODE_SIGN_IDENTITY="${{ secrets.CODE_SIGN_IDENTITY }}" \
DEVELOPMENT_TEAM="${{ secrets.DEVELOPMENT_TEAM }}" \
CODE_SIGN_STYLE=Manual \
MACOSX_DEPLOYMENT_TARGET=15.2
- name: Export app
run: |
# Create export options plist
cat > ExportOptions.plist << EOF
<?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>method</key>
<string>developer-id</string>
<key>teamID</key>
<string>${{ secrets.DEVELOPMENT_TEAM }}</string>
<key>signingStyle</key>
<string>manual</string>
<key>signingCertificate</key>
<string>${{ secrets.CODE_SIGN_IDENTITY }}</string>
<key>stripSwiftSymbols</key>
<true/>
</dict>
</plist>
EOF
# Export the archive
xcodebuild -exportArchive \
-archivePath build/MultiTimeInMenuBar.xcarchive \
-exportPath build/export \
-exportOptionsPlist ExportOptions.plist
- name: Notarize app
run: |
# Store credentials
xcrun notarytool store-credentials "notarytool-profile" \
--apple-id "${{ secrets.APPLE_ID }}" \
--password "${{ secrets.APPLE_APP_PASSWORD }}" \
--team-id "${{ secrets.DEVELOPMENT_TEAM }}"
# Create a zip for notarization
cd build/export
zip -r MultiTimeInMenuBar.zip MultiTimeInMenuBar.app
# Submit for notarization
xcrun notarytool submit MultiTimeInMenuBar.zip \
--keychain-profile "notarytool-profile" \
--wait
# Staple the notarization
xcrun stapler staple MultiTimeInMenuBar.app
- name: Create DMG
run: |
# Install create-dmg if not available
if ! command -v create-dmg &> /dev/null; then
brew install create-dmg
fi
# Create a clean directory with just the app
mkdir -p dmg-contents
cp -R "build/export/MultiTimeInMenuBar.app" dmg-contents/
# Check if app icon exists, try multiple possible locations
ICON_PATH=""
for icon in "MultiTimeInMenuBar/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png" \
"MultiTimeInMenuBar/Assets.xcassets/AppIcon.appiconset/icon_512x512.png" \
"MultiTimeInMenuBar/Assets.xcassets/AppIcon.appiconset/AppIcon.icns" \
"MultiTimeInMenuBar/Assets.xcassets/AppIcon.dataset/AppIcon.icns" \
"MultiTimeInMenuBar/Assets.xcassets/AppIcon.appiconset/AppIcon_512.png"; do
if [ -f "$icon" ]; then
ICON_PATH="$icon"
echo "Found icon at: $icon"
break
fi
done
if [ -z "$ICON_PATH" ]; then
echo "No icon found, DMG will use default appearance"
fi
# Create DMG from clean directory
if [ -n "$ICON_PATH" ]; then
create-dmg \
--volname "MultiTimeInMenuBar" \
--volicon "$ICON_PATH" \
--window-pos 200 120 \
--window-size 600 300 \
--icon-size 100 \
--icon "MultiTimeInMenuBar.app" 175 120 \
--hide-extension "MultiTimeInMenuBar.app" \
--app-drop-link 425 120 \
"MultiTimeInMenuBar.dmg" \
"dmg-contents/"
else
create-dmg \
--volname "MultiTimeInMenuBar" \
--window-pos 200 120 \
--window-size 600 300 \
--icon-size 100 \
--icon "MultiTimeInMenuBar.app" 175 120 \
--hide-extension "MultiTimeInMenuBar.app" \
--app-drop-link 425 120 \
"MultiTimeInMenuBar.dmg" \
"dmg-contents/"
fi
- name: Get version
id: version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION="dev-$(git rev-parse --short HEAD)"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Upload DMG as artifact
uses: actions/upload-artifact@v4
with:
name: MultiTimeInMenuBar-${{ steps.version.outputs.version }}
path: MultiTimeInMenuBar.dmg
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: MultiTimeInMenuBar.dmg
name: MultiTimeInMenuBar ${{ steps.version.outputs.version }}
body: |
## MultiTimeInMenuBar ${{ steps.version.outputs.version }}
A macOS menu bar app that allows you to add clocks of your favorite cities across the world.
### Installation
1. Download the DMG file below
2. Open the DMG and drag MultiTimeInMenuBar.app to your Applications folder
3. Launch the app from Applications or Spotlight
### Requirements
- macOS 15.4 or later
**Note**: This app is signed with a Developer ID certificate but not distributed through the App Store. You may need to allow it in System Preferences > Security & Privacy if macOS blocks it initially.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}