Skip to content

fix: Add missing permissions for GitHub Actions in release workflow #8

fix: Add missing permissions for GitHub Actions in release workflow

fix: Add missing permissions for GitHub Actions in release workflow #8

Workflow file for this run

name: πŸš€ Build and Release ClickIt
on:
push:
tags:
- 'v*' # Trigger on version tags like v1.3.0
workflow_dispatch: # Allow manual triggering
inputs:
tag:
description: 'Tag to build (e.g., v1.3.0)'
required: true
type: string
# Required permissions for GitHub Actions
permissions:
contents: write
packages: read
env:
APP_NAME: "ClickIt"
BUNDLE_ID: "com.jsonify.clickit"
jobs:
build-and-release:
name: πŸ”¨ Build Universal App & Create Release
runs-on: macos-15
steps:
- name: πŸ“₯ Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper tagging
- name: πŸ” Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: πŸ“‹ Extract Version from Tag
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG_NAME="${{ github.event.inputs.tag }}"
else
TAG_NAME=${GITHUB_REF#refs/tags/}
fi
VERSION=${TAG_NAME#v} # Remove 'v' prefix
echo "tag=${TAG_NAME}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "πŸ“¦ Building version: ${VERSION} (tag: ${TAG_NAME})"
- name: πŸ”§ Update Version in Build Script
run: |
sed -i '' "s/VERSION=\"1.0.0\"/VERSION=\"${{ steps.version.outputs.version }}\"/" build_app_unified.sh
echo "βœ… Updated version to ${{ steps.version.outputs.version }}"
- name: πŸ—οΈ Build Universal App with Xcode
run: |
echo "πŸ”¨ Building ${{ env.APP_NAME }} with Xcode..."
# Set environment variables for CI build (disable code signing, fix deployment target)
export CODE_SIGN_IDENTITY=""
export CODE_SIGNING_REQUIRED=NO
export CODE_SIGNING_ALLOWED=NO
export MACOSX_DEPLOYMENT_TARGET=14.0
./build_app_unified.sh release xcode
echo "πŸ“¦ Creating release archive..."
cd dist
zip -r ${{ env.APP_NAME }}.app.zip ${{ env.APP_NAME }}.app
cd ..
echo "πŸ“‹ Build completed successfully!"
ls -la dist/
- name: πŸ” Verify Build
run: |
echo "πŸ” Verifying app bundle..."
if [ -d "dist/${{ env.APP_NAME }}.app" ]; then
echo "βœ… App bundle created successfully"
ls -la "dist/${{ env.APP_NAME }}.app/Contents/"
# Check if binary exists and get architecture info
if [ -f "dist/${{ env.APP_NAME }}.app/Contents/MacOS/${{ env.APP_NAME }}" ]; then
echo "πŸ“± Binary architecture:"
file "dist/${{ env.APP_NAME }}.app/Contents/MacOS/${{ env.APP_NAME }}"
fi
else
echo "❌ App bundle not found!"
exit 1
fi
if [ -f "dist/${{ env.APP_NAME }}.app.zip" ]; then
echo "βœ… Archive created successfully"
ls -lh "dist/${{ env.APP_NAME }}.app.zip"
else
echo "❌ Archive not found!"
exit 1
fi
- name: πŸ“ Generate Release Notes
id: release_notes
run: |
TAG_NAME="${{ steps.version.outputs.tag }}"
VERSION="${{ steps.version.outputs.version }}"
# Get the previous tag for changelog
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD~1 2>/dev/null || echo "")
echo "# ${{ env.APP_NAME }} ${TAG_NAME}" > release_notes.md
echo "" >> release_notes.md
echo "πŸŽ‰ **Native macOS Auto-Clicker Application**" >> release_notes.md
echo "" >> release_notes.md
echo "## ✨ Features" >> release_notes.md
echo "- πŸ–±οΈ **Precision Clicking**: Sub-10ms timing accuracy" >> release_notes.md
echo "- 🌐 **Universal Binary**: Native support for Intel x64 + Apple Silicon" >> release_notes.md
echo "- 🎯 **Background Operation**: Works without requiring app focus" >> release_notes.md
echo "- ⚑ **Global Hotkeys**: ESC key controls for instant stop" >> release_notes.md
echo "- πŸ”§ **Advanced Configuration**: CPS rates, click types, and presets" >> release_notes.md
echo "- πŸ‘οΈ **Visual Feedback**: Real-time overlay indicators" >> release_notes.md
echo "- πŸ”„ **Auto-Updates**: Built-in Sparkle framework integration" >> release_notes.md
echo "" >> release_notes.md
echo "## πŸ“‹ System Requirements" >> release_notes.md
echo "- **macOS**: 14.0 or later" >> release_notes.md
echo "- **Architecture**: Universal Binary (Intel x64 + Apple Silicon)" >> release_notes.md
echo "- **Permissions**: Accessibility and Screen Recording access required" >> release_notes.md
echo "" >> release_notes.md
echo "## πŸš€ Installation" >> release_notes.md
echo "1. Download \`${{ env.APP_NAME }}.app.zip\` below" >> release_notes.md
echo "2. Extract and move \`${{ env.APP_NAME }}.app\` to Applications folder" >> release_notes.md
echo "3. First launch: Right-click β†’ Open (to bypass Gatekeeper)" >> release_notes.md
echo "4. Grant Accessibility and Screen Recording permissions when prompted" >> release_notes.md
echo "" >> release_notes.md
if [ -n "$PREVIOUS_TAG" ]; then
echo "## πŸ“ˆ Changes Since ${PREVIOUS_TAG}" >> release_notes.md
echo "\`\`\`" >> release_notes.md
git log --oneline ${PREVIOUS_TAG}..HEAD --pretty=format:"- %s" >> release_notes.md || echo "- Initial release" >> release_notes.md
echo "" >> release_notes.md
echo "\`\`\`" >> release_notes.md
echo "" >> release_notes.md
fi
echo "---" >> release_notes.md
echo "" >> release_notes.md
echo "πŸ—οΈ **Built with**: Xcode on GitHub Actions" >> release_notes.md
echo "πŸ“… **Build Date**: $(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> release_notes.md
echo "πŸ”– **Version**: ${VERSION}" >> release_notes.md
echo "🎯 **Target**: macOS 14.0+" >> release_notes.md
echo "release_notes_file=release_notes.md" >> $GITHUB_OUTPUT
- name: πŸš€ Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.tag }}
name: "${{ env.APP_NAME }} ${{ steps.version.outputs.tag }}"
body_path: release_notes.md
draft: false
prerelease: false
files: |
dist/${{ env.APP_NAME }}.app.zip
dist/build-info.txt
token: ${{ secrets.GITHUB_TOKEN }}
- name: βœ… Release Complete
run: |
echo "πŸŽ‰ Release ${{ steps.version.outputs.tag }} completed successfully!"
echo "πŸ“‚ Release URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.version.outputs.tag }}"
echo "πŸ“¦ Assets uploaded:"
echo " - ${{ env.APP_NAME }}.app.zip (Universal macOS App)"
echo " - build-info.txt (Build metadata)"