1+ name : 🚀 Build and Release ClickIt
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*' # Trigger on version tags like v1.3.0
7+ workflow_dispatch : # Allow manual triggering
8+ inputs :
9+ tag :
10+ description : ' Tag to build (e.g., v1.3.0)'
11+ required : true
12+ type : string
13+
14+ env :
15+ APP_NAME : " ClickIt"
16+ BUNDLE_ID : " com.jsonify.clickit"
17+
18+ jobs :
19+ build-and-release :
20+ name : 🔨 Build Universal App & Create Release
21+ runs-on : macos-latest
22+
23+ steps :
24+ - name : 📥 Checkout Code
25+ uses : actions/checkout@v4
26+ with :
27+ fetch-depth : 0 # Fetch all history for proper tagging
28+
29+ - name : 🔍 Setup Xcode
30+ uses : maxim-lobanov/setup-xcode@v1
31+ with :
32+ xcode-version : latest-stable
33+
34+ - name : 📋 Extract Version from Tag
35+ id : version
36+ run : |
37+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
38+ TAG_NAME="${{ github.event.inputs.tag }}"
39+ else
40+ TAG_NAME=${GITHUB_REF#refs/tags/}
41+ fi
42+ VERSION=${TAG_NAME#v} # Remove 'v' prefix
43+ echo "tag=${TAG_NAME}" >> $GITHUB_OUTPUT
44+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
45+ echo "📦 Building version: ${VERSION} (tag: ${TAG_NAME})"
46+
47+ - name : 🔧 Update Version in Build Script
48+ run : |
49+ sed -i '' "s/VERSION=\"1.0.0\"/VERSION=\"${{ steps.version.outputs.version }}\"/" build_app_unified.sh
50+ echo "✅ Updated version to ${{ steps.version.outputs.version }}"
51+
52+ - name : 🏗️ Build Universal App with Xcode
53+ run : |
54+ echo "🔨 Building ${{ env.APP_NAME }} with Xcode..."
55+ ./build_app_unified.sh release xcode
56+
57+ echo "📦 Creating release archive..."
58+ cd dist
59+ zip -r ${{ env.APP_NAME }}.app.zip ${{ env.APP_NAME }}.app
60+ cd ..
61+
62+ echo "📋 Build completed successfully!"
63+ ls -la dist/
64+
65+ - name : 🔍 Verify Build
66+ run : |
67+ echo "🔍 Verifying app bundle..."
68+ if [ -d "dist/${{ env.APP_NAME }}.app" ]; then
69+ echo "✅ App bundle created successfully"
70+ ls -la "dist/${{ env.APP_NAME }}.app/Contents/"
71+
72+ # Check if binary exists and get architecture info
73+ if [ -f "dist/${{ env.APP_NAME }}.app/Contents/MacOS/${{ env.APP_NAME }}" ]; then
74+ echo "📱 Binary architecture:"
75+ file "dist/${{ env.APP_NAME }}.app/Contents/MacOS/${{ env.APP_NAME }}"
76+ fi
77+ else
78+ echo "❌ App bundle not found!"
79+ exit 1
80+ fi
81+
82+ if [ -f "dist/${{ env.APP_NAME }}.app.zip" ]; then
83+ echo "✅ Archive created successfully"
84+ ls -lh "dist/${{ env.APP_NAME }}.app.zip"
85+ else
86+ echo "❌ Archive not found!"
87+ exit 1
88+ fi
89+
90+ - name : 📝 Generate Release Notes
91+ id : release_notes
92+ run : |
93+ TAG_NAME="${{ steps.version.outputs.tag }}"
94+ VERSION="${{ steps.version.outputs.version }}"
95+
96+ # Get the previous tag for changelog
97+ PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
98+
99+ echo "# ${{ env.APP_NAME }} ${TAG_NAME}" > release_notes.md
100+ echo "" >> release_notes.md
101+ echo "🎉 **Native macOS Auto-Clicker Application**" >> release_notes.md
102+ echo "" >> release_notes.md
103+ echo "## ✨ Features" >> release_notes.md
104+ echo "- 🖱️ **Precision Clicking**: Sub-10ms timing accuracy" >> release_notes.md
105+ echo "- 🌐 **Universal Binary**: Native support for Intel x64 + Apple Silicon" >> release_notes.md
106+ echo "- 🎯 **Background Operation**: Works without requiring app focus" >> release_notes.md
107+ echo "- ⚡ **Global Hotkeys**: ESC key controls for instant stop" >> release_notes.md
108+ echo "- 🔧 **Advanced Configuration**: CPS rates, click types, and presets" >> release_notes.md
109+ echo "- 👁️ **Visual Feedback**: Real-time overlay indicators" >> release_notes.md
110+ echo "- 🔄 **Auto-Updates**: Built-in Sparkle framework integration" >> release_notes.md
111+ echo "" >> release_notes.md
112+ echo "## 📋 System Requirements" >> release_notes.md
113+ echo "- **macOS**: 15.0 or later" >> release_notes.md
114+ echo "- **Architecture**: Universal Binary (Intel x64 + Apple Silicon)" >> release_notes.md
115+ echo "- **Permissions**: Accessibility and Screen Recording access required" >> release_notes.md
116+ echo "" >> release_notes.md
117+ echo "## 🚀 Installation" >> release_notes.md
118+ echo "1. Download \`${{ env.APP_NAME }}.app.zip\` below" >> release_notes.md
119+ echo "2. Extract and move \`${{ env.APP_NAME }}.app\` to Applications folder" >> release_notes.md
120+ echo "3. First launch: Right-click → Open (to bypass Gatekeeper)" >> release_notes.md
121+ echo "4. Grant Accessibility and Screen Recording permissions when prompted" >> release_notes.md
122+ echo "" >> release_notes.md
123+
124+ if [ -n "$PREVIOUS_TAG" ]; then
125+ echo "## 📈 Changes Since ${PREVIOUS_TAG}" >> release_notes.md
126+ echo "\`\`\`" >> release_notes.md
127+ git log --oneline ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s" >> release_notes.md || echo "- Initial release" >> release_notes.md
128+ echo "" >> release_notes.md
129+ echo "\`\`\`" >> release_notes.md
130+ echo "" >> release_notes.md
131+ fi
132+
133+ echo "---" >> release_notes.md
134+ echo "" >> release_notes.md
135+ echo "🏗️ **Built with**: Xcode on GitHub Actions" >> release_notes.md
136+ echo "📅 **Build Date**: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> release_notes.md
137+ echo "🔖 **Version**: ${VERSION}" >> release_notes.md
138+ echo "🎯 **Target**: macOS 15.0+" >> release_notes.md
139+
140+ echo "release_notes_file=release_notes.md" >> $GITHUB_OUTPUT
141+
142+ - name : 🚀 Create GitHub Release
143+ uses : softprops/action-gh-release@v1
144+ with :
145+ tag_name : ${{ steps.version.outputs.tag }}
146+ name : " ${{ env.APP_NAME }} ${{ steps.version.outputs.tag }}"
147+ body_path : release_notes.md
148+ draft : false
149+ prerelease : false
150+ make_latest : true
151+ files : |
152+ dist/${{ env.APP_NAME }}.app.zip
153+ dist/build-info.txt
154+ token : ${{ secrets.GITHUB_TOKEN }}
155+
156+ - name : ✅ Release Complete
157+ run : |
158+ echo "🎉 Release ${{ steps.version.outputs.tag }} completed successfully!"
159+ echo "📂 Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.tag }}"
160+ echo "📦 Assets uploaded:"
161+ echo " - ${{ env.APP_NAME }}.app.zip (Universal macOS App)"
162+ echo " - build-info.txt (Build metadata)"
0 commit comments