Skip to content

Commit 8d60c72

Browse files
committed
add macos build
1 parent 6c1d2d0 commit 8d60c72

File tree

1 file changed

+52
-33
lines changed

1 file changed

+52
-33
lines changed

.github/workflows/release.yml

+52-33
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,38 @@ jobs:
5353
uses: actions/setup-go@v5
5454
with:
5555
go-version: 1.22
56-
- name: Build Fyne application for macOS
57-
# run: fyne package -os darwin -icon Icon.png
58-
run: GOOS=darwin GOARCH=arm64 go build -o SoundscapeSync.app
56+
- name: Compile for MacOS
57+
run: |
58+
GOOS=darwin GOARCH=arm64 go build -o SoundscapeSync_arm64
59+
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o SoundscapeSync_amd64
60+
lipo -create -output SoundscapeSync SoundscapeSync_amd64 SoundscapeSync_arm64
61+
mkdir -p SoundscapeSync.app/Contents/MacOS
62+
mv SoundscapeSync SoundscapeSync.app/Contents/MacOS/SoundscapeSync
63+
echo '<?xml version="1.0" encoding="UTF-8"?>' > SoundscapeSync.app/Contents/Info.plist
64+
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> SoundscapeSync.app/Contents/Info.plist
65+
echo '<plist version="1.0">' >> SoundscapeSync.app/Contents/Info.plist
66+
echo '<dict>' >> SoundscapeSync.app/Contents/Info.plist
67+
echo ' <key>CFBundleName</key>' >> SoundscapeSync.app/Contents/Info.plist
68+
echo ' <string>SoundscapeSync</string>' >> SoundscapeSync.app/Contents/Info.plist
69+
echo ' <key>CFBundleVersion</key>' >> SoundscapeSync.app/Contents/Info.plist
70+
echo ' <string>1.0</string>' >> SoundscapeSync.app/Contents/Info.plist
71+
echo ' <key>CFBundleIdentifier</key>' >> SoundscapeSync.app/Contents/Info.plist
72+
echo ' <string>com.cloonar.soundscape-sync</string>' >> SoundscapeSync.app/Contents/Info.plist
73+
echo ' <key>Executable</key>' >> SoundscapeSync.app/Contents/Info.plist
74+
echo ' <string>SoundscapeSync</string>' >> SoundscapeSync.app/Contents/Info.plist
75+
echo '</dict>' >> SoundscapeSync.app/Contents/Info.plist
76+
echo '</plist>' >> SoundscapeSync.app/Contents/Info.plist
77+
chmod +x SoundscapeSync.app/Contents/MacOS/SoundscapeSync
78+
zip -r SoundscapeSync.app.zip SoundscapeSync.app
5979
- name: Upload macOS artifact
6080
uses: actions/upload-artifact@v4
6181
with:
6282
name: macos-build
63-
path: SoundscapeSync.app
83+
path: SoundscapeSync.app.zip
6484

6585
create-release:
6686
runs-on: ubuntu-latest
67-
# needs: [build-linux, build-windows, build-mac]
68-
needs: [build-windows, build-linux]
87+
needs: [build-linux, build-windows, build-mac]
6988
steps:
7089
- name: Generate Changelog
7190
id: changelog
@@ -77,13 +96,13 @@ jobs:
7796
id: create_release
7897
uses: actions/create-release@v1
7998
env:
80-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81100
with:
82-
tag_name: ${{ github.ref_name }} # Tag name from the push event
83-
release_name: Release ${{ github.ref_name }} # Name of the release
101+
tag_name: ${{ github.ref_name }}
102+
release_name: Release ${{ github.ref_name }}
84103
body: ${{ steps.changelog.outputs.changes }}
85-
draft: false # Set to true if you want to create a draft release
86-
prerelease: true # Set to true if this is a prerelease
104+
draft: false
105+
prerelease: true
87106

88107
# - uses: actions/download-artifact@v4
89108
# with:
@@ -116,35 +135,35 @@ jobs:
116135
- name: Upload Linux Asset
117136
uses: actions/upload-release-asset@v1
118137
env:
119-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
138+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120139
with:
121-
upload_url: ${{ steps.create_release.outputs.upload_url }} # URL for uploading assets
122-
asset_path: soundscape-sync # Path to your asset file
123-
asset_name: soundscape-sync-linux-x86 # Name of the asset file
124-
asset_content_type: application/octet-stream # Content type of the asset
140+
upload_url: ${{ steps.create_release.outputs.upload_url }}
141+
asset_path: soundscape-sync
142+
asset_name: soundscape-sync-linux-x86
143+
asset_content_type: application/octet-stream
125144

126145
- uses: actions/download-artifact@v4
127146
with:
128147
name: windows-build
129148
- name: Upload Windows Asset
130149
uses: actions/upload-release-asset@v1
131150
env:
132-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
151+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133152
with:
134-
upload_url: ${{ steps.create_release.outputs.upload_url }} # URL for uploading assets
135-
asset_path: SoundscapeSync.exe # Path to your asset file
136-
asset_name: SoundscapeSync.exe # Name of the asset file
137-
asset_content_type: application/x-msdownload # Content type of the asset
153+
upload_url: ${{ steps.create_release.outputs.upload_url }}
154+
asset_path: SoundscapeSync.exe
155+
asset_name: SoundscapeSync.exe
156+
asset_content_type: application/x-msdownload
138157

139-
# - uses: actions/download-artifact@v4
140-
# with:
141-
# name: macos-build
142-
# - name: Upload MacOS Asset
143-
# uses: actions/upload-release-asset@v1
144-
# env:
145-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
146-
# with:
147-
# upload_url: ${{ steps.create_release.outputs.upload_url }} # URL for uploading assets
148-
# asset_path: SoundscapeSync.app # Path to your asset file
149-
# asset_name: SoundscapeSync.app # Name of the asset file
150-
# asset_content_type: application/octet-stream # Content type of the asset
158+
- uses: actions/download-artifact@v4
159+
with:
160+
name: macos-build
161+
- name: Upload MacOS Asset
162+
uses: actions/upload-release-asset@v1
163+
env:
164+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
165+
with:
166+
upload_url: ${{ steps.create_release.outputs.upload_url }}
167+
asset_path: SoundscapeSync.app.zip
168+
asset_name: MacOS
169+
asset_content_type: application/zip

0 commit comments

Comments
 (0)