Skip to content

Commit f868b16

Browse files
committed
test release
1 parent 054125f commit f868b16

File tree

1 file changed

+190
-0
lines changed

1 file changed

+190
-0
lines changed

.github/workflows/test.yaml

+190
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build-linux:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
lfs: true
17+
- name: Set up Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: 1.22
21+
- name: Install fyne-cross
22+
run: go install github.com/fyne-io/fyne-cross@latest
23+
- name: Cross-compile for Linux
24+
run: fyne-cross linux
25+
- name: Upload Linux artifact
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: linux-build
29+
path: fyne-cross/bin/linux-amd64
30+
31+
build-windows:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
with:
36+
lfs: true
37+
- name: Set up Go
38+
uses: actions/setup-go@v5
39+
with:
40+
go-version: 1.22
41+
- name: Install fyne-cross
42+
run: go install github.com/fyne-io/fyne-cross@latest
43+
- name: Cross-compile for Windows
44+
run: fyne-cross windows
45+
- name: Upload Windows artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: windows-build
49+
path: fyne-cross/bin/windows-amd64
50+
51+
build-mac:
52+
runs-on: macos-latest
53+
steps:
54+
- uses: actions/checkout@v4
55+
with:
56+
lfs: true
57+
- name: Set up Go
58+
uses: actions/setup-go@v5
59+
with:
60+
go-version: 1.22
61+
- name: Compile for MacOS
62+
run: |
63+
GOOS=darwin GOARCH=arm64 go build -o SoundscapeSync_arm64
64+
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o SoundscapeSync_amd64
65+
lipo -create -output SoundscapeSync SoundscapeSync_amd64 SoundscapeSync_arm64
66+
mkdir -p SoundscapeSync.app/Contents/MacOS
67+
mv SoundscapeSync SoundscapeSync.app/Contents/MacOS/SoundscapeSync
68+
echo '<?xml version="1.0" encoding="UTF-8"?>' > SoundscapeSync.app/Contents/Info.plist
69+
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> SoundscapeSync.app/Contents/Info.plist
70+
echo '<plist version="1.0">' >> SoundscapeSync.app/Contents/Info.plist
71+
echo '<dict>' >> SoundscapeSync.app/Contents/Info.plist
72+
echo ' <key>CFBundleName</key>' >> SoundscapeSync.app/Contents/Info.plist
73+
echo ' <string>SoundscapeSync</string>' >> SoundscapeSync.app/Contents/Info.plist
74+
echo ' <key>CFBundleVersion</key>' >> SoundscapeSync.app/Contents/Info.plist
75+
echo ' <string>1.0</string>' >> SoundscapeSync.app/Contents/Info.plist
76+
echo ' <key>CFBundleIdentifier</key>' >> SoundscapeSync.app/Contents/Info.plist
77+
echo ' <string>com.cloonar.soundscape-sync</string>' >> SoundscapeSync.app/Contents/Info.plist
78+
echo ' <key>Executable</key>' >> SoundscapeSync.app/Contents/Info.plist
79+
echo ' <string>SoundscapeSync</string>' >> SoundscapeSync.app/Contents/Info.plist
80+
echo '</dict>' >> SoundscapeSync.app/Contents/Info.plist
81+
echo '</plist>' >> SoundscapeSync.app/Contents/Info.plist
82+
chmod +x SoundscapeSync.app/Contents/MacOS/SoundscapeSync
83+
zip -r SoundscapeSync.app.zip SoundscapeSync.app
84+
- name: Upload macOS artifact
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: macos-build
88+
path: SoundscapeSync.app.zip
89+
90+
create-release:
91+
runs-on: ubuntu-latest
92+
needs: [build-linux, build-windows, build-mac]
93+
steps:
94+
- name: Generate Changelog
95+
id: changelog
96+
uses: requarks/changelog-action@v1
97+
with:
98+
token: ${{ secrets.GITHUB_TOKEN }}
99+
tag: v0.9
100+
- name: Create Release
101+
id: create_release
102+
uses: actions/create-release@v1
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105+
with:
106+
tag_name: v0.9
107+
release_name: Release test
108+
body: ${{ steps.changelog.outputs.changes }}
109+
draft: true
110+
prerelease: true
111+
112+
# - uses: actions/download-artifact@v4
113+
# with:
114+
# name: linux-build
115+
# - name: Prepare DEB package
116+
# run: |
117+
# mkdir -p .debpkg/DEBIAN
118+
# echo "Package: SoundscapeSync" > .debpkg/DEBIAN/control
119+
# echo "Version: ${{ github.event.inputs.version }}" >> .debpkg/DEBIAN/control
120+
# echo "Architecture: amd64" >> .debpkg/DEBIAN/control
121+
# echo "Maintainer: Dominik Polakovics <[email protected]>" >> .debpkg/DEBIAN/control
122+
# mkdir -p .debpkg/usr/bin
123+
# cp fyne-cross/bin/linux-amd64/soundscape-sync .debpkg/usr/bin
124+
# - name: Create DEB package
125+
# uses: jiro4989/build-deb-action@v3
126+
# with:
127+
# package: SoundscapeSync
128+
# package_root: .debpkg
129+
# maintainer: "Dominik Polakovics <[email protected]>"
130+
# version: "${{ github.event.inputs.version }}"
131+
# arch: 'amd64'
132+
# desc: 'This is my sample package.'
133+
# depends: 'ffmpeg'
134+
# - name: get file name
135+
# run: |
136+
# mv *.deb soundscapesync-${{ github.event.inputs.version }}.deb
137+
- uses: actions/download-artifact@v4
138+
with:
139+
name: linux-build
140+
- name: Upload Linux Asset
141+
uses: actions/upload-release-asset@v1
142+
env:
143+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
with:
145+
upload_url: ${{ steps.create_release.outputs.upload_url }}
146+
asset_path: soundscape-sync
147+
asset_name: soundscape-sync-linux-x86
148+
asset_content_type: application/octet-stream
149+
150+
- uses: actions/download-artifact@v4
151+
with:
152+
name: windows-build
153+
- name: Upload Windows Asset
154+
uses: actions/upload-release-asset@v1
155+
env:
156+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157+
with:
158+
upload_url: ${{ steps.create_release.outputs.upload_url }}
159+
asset_path: SoundscapeSync.exe
160+
asset_name: SoundscapeSync.exe
161+
asset_content_type: application/x-msdownload
162+
163+
- uses: actions/download-artifact@v4
164+
with:
165+
name: macos-build
166+
- name: Upload MacOS Asset
167+
uses: actions/upload-release-asset@v1
168+
env:
169+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
170+
with:
171+
upload_url: ${{ steps.create_release.outputs.upload_url }}
172+
asset_path: SoundscapeSync.app.zip
173+
asset_name: MacOS.zip
174+
asset_content_type: application/zip
175+
176+
- name: Generate checksum
177+
uses: jmgilman/actions-generate-checksum@v1
178+
with:
179+
patterns: |
180+
SoundscapeSync.exe
181+
SoundscapeSync.app.zip
182+
- name: Upload checksum
183+
uses: actions/upload-release-asset@v1
184+
env:
185+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
186+
with:
187+
upload_url: ${{ steps.create_release.outputs.upload_url }}
188+
asset_path: checksum.txt
189+
asset_name: checksum.txt
190+
asset_content_type: text/plain

0 commit comments

Comments
 (0)