Add GitHub Actions workflow for automated builds #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '16.0' | |
- name: Set environment variables | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
# Extract short SHA for development builds | |
if [[ "$GITHUB_REF" != "refs/tags/"* ]]; then | |
echo "RELEASE_VERSION=dev-$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
fi | |
- name: Build macOS App | |
run: | | |
# Build without code signing for CI | |
xcodebuild -project CopilotApp.xcodeproj -scheme CopilotApp -configuration Release -destination 'platform=macOS' clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | |
- name: Create .app package | |
run: | | |
# Create the app bundle | |
mkdir -p dist | |
cp -R build/Release/GitHub\ Copilot.app dist/ | |
cd dist | |
# Compress the .app bundle | |
zip -r "GitHubCopilotApp-${{ env.RELEASE_VERSION }}.zip" "GitHub Copilot.app" | |
ls -la | |
- name: Upload app as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: GitHubCopilotApp-${{ env.RELEASE_VERSION }} | |
path: dist/GitHubCopilotApp-${{ env.RELEASE_VERSION }}.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-${{ env.RELEASE_VERSION }}.zip | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |