-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (92 loc) · 3.92 KB
/
build-macos-app.yml
File metadata and controls
114 lines (92 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Build macOS App
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
workflow_dispatch: # Allows manual triggering from GitHub UI
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest-stable'
- name: Set environment variables
run: |
if [[ "$GITHUB_REF" == "refs/tags/"* ]]; then
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
else
# Extract short SHA for development builds
echo "RELEASE_VERSION=dev-$(git rev-parse --short HEAD)" >> $GITHUB_ENV
fi
- name: Build macOS App
run: |
# Get available schemes
echo "Available schemes:"
xcodebuild -list -project CopilotApp.xcodeproj
# Build without code signing for CI and specify derivedDataPath to know exact output location
xcodebuild -project CopilotApp.xcodeproj -scheme CopilotApp -configuration Release -destination 'platform=macOS' -derivedDataPath ./DerivedData clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
- name: Create .app package
run: |
# Create the output directory
mkdir -p dist
# Debug: Show all files in the derived data directory
echo "Contents of DerivedData directory:"
find ./DerivedData -type d -name "*.app" | sort
# Find the app using find command
APP_PATH=$(find ./DerivedData -type d -name "GitHub Copilot.app" | head -n 1)
if [ -z "$APP_PATH" ]; then
echo "Could not find 'GitHub Copilot.app', trying alternative names..."
APP_PATH=$(find ./DerivedData -type d -name "*.app" | head -n 1)
fi
if [ -z "$APP_PATH" ]; then
echo "ERROR: Could not find any .app bundle in the build output"
find ./DerivedData -type d | sort
exit 1
fi
echo "Found app at: $APP_PATH"
cp -R "$APP_PATH" dist/
cd dist
# Remove extended attributes that might cause "damaged" errors
echo "Removing extended attributes from app bundle..."
xattr -cr "GitHub Copilot.app"
# Compress the .app bundle
APP_NAME=$(basename "$APP_PATH")
zip -r "GitHubCopilotApp-$RELEASE_VERSION.zip" "$APP_NAME"
ls -la
- name: Upload app as artifact
uses: actions/upload-artifact@v4
with:
name: GitHubCopilotApp
path: dist/GitHubCopilotApp-*.zip
# Only run this step for tagged releases
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: dist/GitHubCopilotApp-*.zip
draft: true
prerelease: false
generate_release_notes: true
body: |
## GitHub Copilot App
A simple macOS application that provides a clean wrapper for GitHub Copilot's web interface.
### Installation
1. Download the zip file attached to this release
2. Extract and move GitHub Copilot.app to your Applications folder
3. Right-click and select "Open" the first time you run it (to bypass Gatekeeper)
### Troubleshooting: "App is damaged" Error
If you see a message saying the app is "damaged and can't be opened":
1. Open Terminal and run this command:
```
xattr -cr /Applications/GitHub\ Copilot.app
```
2. Try opening the app again
This happens because the app isn't signed with an Apple Developer certificate. The command removes quarantine attributes that macOS adds to downloaded files.
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}