-
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (93 loc) · 3.4 KB
/
main.yml
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
name: Cross-compile with fyne-cross
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- '.github/workflows/release.yml'
- '.github/FUNDING.yml'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- '.github/workflows/release.yml'
- '.github/FUNDING.yml'
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Install fyne-cross
run: go install github.com/fyne-io/fyne-cross@latest
- name: Cross-compile for Linux
run: fyne-cross linux
- name: Upload Linux artifact
uses: actions/upload-artifact@v4
with:
name: linux-build
path: fyne-cross/bin/linux-amd64
build-windows:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Install fyne-cross
run: go install github.com/fyne-io/fyne-cross@latest
- name: Cross-compile for Windows
run: fyne-cross windows
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: windows-build
path: fyne-cross/bin/windows-amd64
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Compile for MacOS
run: |
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 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
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
zip -r SoundscapeSync.app.zip SoundscapeSync.app
- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: macos-build
path: SoundscapeSync.app.zip