Skip to content

Commit

Permalink
try universal app build
Browse files Browse the repository at this point in the history
  • Loading branch information
dpolakovics committed Nov 7, 2024
1 parent 3695f92 commit 493af25
Showing 1 changed file with 7 additions and 40 deletions.
47 changes: 7 additions & 40 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Cross-compile for Windows
run: fyne-cross windows

build-mac-arm:
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -53,9 +53,11 @@ jobs:
go-version: 1.22
- name: Compile for MacOS
run: |
GOOS=darwin GOARCH=arm64 go build
GOOS=darwin GOARCH=arm64 go build -o SoundscapeSync_arm64
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o SoundscapeSync_amd64
lipo -create -output SoundscapeSync SoundscapeSync_amd64 SoundscapeSync_arm64
mkdir -p SoundscapeSync.app/Contents/MacOS
mv soundscape-sync SoundscapeSync.app/Contents/MacOS/SoundscapeSync
mv SoundscapeSync SoundscapeSync.app/Contents/MacOS/SoundscapeSync
echo '<?xml version="1.0" encoding="UTF-8"?>' > SoundscapeSync.app/Contents/Info.plist
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> SoundscapeSync.app/Contents/Info.plist
echo '<plist version="1.0">' >> SoundscapeSync.app/Contents/Info.plist
Expand All @@ -72,43 +74,8 @@ jobs:
echo '</plist>' >> SoundscapeSync.app/Contents/Info.plist
chmod +x SoundscapeSync.app/Contents/MacOS/SoundscapeSync
- name: Upload macOS arm artifact
- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: macos-build
path: SoundscapeSync-arm.app

build-mac-intel:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Compile for MacOS
run: |
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build
mkdir -p SoundscapeSync.app/Contents/MacOS
mv soundscape-sync SoundscapeSync.app/Contents/MacOS/SoundscapeSync
echo '<?xml version="1.0" encoding="UTF-8"?>' > SoundscapeSync.app/Contents/Info.plist
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> SoundscapeSync.app/Contents/Info.plist
echo '<plist version="1.0">' >> SoundscapeSync.app/Contents/Info.plist
echo '<dict>' >> SoundscapeSync.app/Contents/Info.plist
echo ' <key>CFBundleName</key>' >> SoundscapeSync.app/Contents/Info.plist
echo ' <string>SoundscapeSync</string>' >> SoundscapeSync.app/Contents/Info.plist
echo ' <key>CFBundleVersion</key>' >> SoundscapeSync.app/Contents/Info.plist
echo ' <string>1.0</string>' >> SoundscapeSync.app/Contents/Info.plist
echo ' <key>CFBundleIdentifier</key>' >> SoundscapeSync.app/Contents/Info.plist
echo ' <string>com.cloonar.soundscape-sync</string>' >> SoundscapeSync.app/Contents/Info.plist
echo ' <key>Executable</key>' >> SoundscapeSync.app/Contents/Info.plist
echo ' <string>SoundscapeSync</string>' >> SoundscapeSync.app/Contents/Info.plist
echo '</dict>' >> SoundscapeSync.app/Contents/Info.plist
echo '</plist>' >> SoundscapeSync.app/Contents/Info.plist
chmod +x SoundscapeSync.app/Contents/MacOS/SoundscapeSync
- name: Upload macOS intel artifact
uses: actions/upload-artifact@v4
with:
name: macos-build
path: SoundscapeSync-intel.app
path: SoundscapeSync.app

0 comments on commit 493af25

Please sign in to comment.