Repository navigation
172 lines (144 loc) · 5.54 KB
/
Copy pathrelease.yml
File metadata and controls
172 lines (144 loc) · 5.54 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: stable
- uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ggwave-linux:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libasound2-dev
- name: Install ggwave
run: |
git clone --recursive https://github.com/ggerganov/ggwave.git /tmp/ggwave
cd /tmp/ggwave && mkdir build && cd build
cmake .. -DGGWAVE_BUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF
make -j$(nproc) && sudo make install && sudo ldconfig
- name: Install portaudio
run: |
git clone https://github.com/PortAudio/portaudio.git /tmp/portaudio
cd /tmp/portaudio && mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF
make -j$(nproc) && sudo make install && sudo ldconfig
- name: Build
run: CGO_ENABLED=1 go build -o ggwave ./cmd/ggwave
env:
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
- name: Package
run: tar czf ggwave-linux-amd64.tar.gz ggwave
- name: Upload to release
run: gh release upload ${{ github.ref_name }} ggwave-linux-amd64.tar.gz --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ggwave-macos:
needs: release
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Install ggwave
run: |
git clone --recursive https://github.com/ggerganov/ggwave.git /tmp/ggwave
cd /tmp/ggwave && mkdir build && cd build
cmake .. -DGGWAVE_BUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF
make -j$(sysctl -n hw.ncpu) && sudo make install
- name: Install portaudio
run: |
git clone https://github.com/PortAudio/portaudio.git /tmp/portaudio
cd /tmp/portaudio && mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF
make -j$(sysctl -n hw.ncpu) && sudo make install
- name: Build
run: CGO_ENABLED=1 go build -o ggwave ./cmd/ggwave
env:
PKG_CONFIG_PATH: /usr/local/lib/pkgconfig
- name: Package
run: tar czf ggwave-darwin-arm64.tar.gz ggwave
- name: Upload to release
run: gh release upload ${{ github.ref_name }} ggwave-darwin-arm64.tar.gz --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ggwave-windows:
needs: release
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Install pkg-config
shell: pwsh
run: choco install pkgconfiglite -y
- name: Install ggwave
run: |
git clone --recursive https://github.com/ggerganov/ggwave.git /c/ggwave
cd /c/ggwave && mkdir build && cd build
cmake .. -G "MinGW Makefiles" -DGGWAVE_BUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX=/c/ggwave-install
mingw32-make -j2
mingw32-make install
- name: Install portaudio
run: |
git clone https://github.com/PortAudio/portaudio.git /c/portaudio
cd /c/portaudio && mkdir build && cd build
cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=/c/portaudio-install -DBUILD_SHARED_LIBS=OFF
mingw32-make -j2
mingw32-make install
- name: Build
run: |
export PATH="/c/ProgramData/chocolatey/bin:$PATH"
export PKG_CONFIG_PATH="C:/portaudio-install/lib/pkgconfig"
CGO_ENABLED=1 \
CGO_CFLAGS="-IC:/ggwave-install/include -IC:/portaudio-install/include" \
CGO_LDFLAGS="-LC:/ggwave-install/lib/static -LC:/portaudio-install/lib -static -lggwave -lportaudio -lstdc++ -lole32 -lwinmm -lsetupapi -lpthread" \
go build -o ggwave.exe ./cmd/ggwave
- name: Package
shell: pwsh
run: Compress-Archive -Path ggwave.exe -DestinationPath ggwave-windows-amd64.zip
- name: Upload to release
run: gh release upload ${{ github.ref_name }} ggwave-windows-amd64.zip --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ggwave-checksums:
needs: [ggwave-linux, ggwave-macos, ggwave-windows]
runs-on: ubuntu-latest
steps:
- name: Download ggwave assets
run: gh release download "$GITHUB_REF_NAME" -R "$GITHUB_REPOSITORY" -p 'ggwave-*.tar.gz' -p 'ggwave-*.zip' -D dist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate checksums
working-directory: dist
run: sha256sum ggwave-*.tar.gz ggwave-*.zip > "ggwave-${GITHUB_REF_NAME#v}-checksums.txt"
- name: Upload to release
working-directory: dist
run: gh release upload "$GITHUB_REF_NAME" -R "$GITHUB_REPOSITORY" "ggwave-${GITHUB_REF_NAME#v}-checksums.txt" --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}