-
-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (151 loc) · 5.29 KB
/
build-deploy.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
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
name: Build and github release
on:
push:
jobs:
build-windows:
name: Build windows release and debug
runs-on: windows-2019
steps:
- name: Install XMake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
shell: cmd
run: |
xmake config -m release -k vsxmake -y
xmake build
xmake config -m debug -k vsxmake -y
xmake build
- name: Copy files
shell: cmd
run: |
mkdir upload
mkdir upload\lib\release
mkdir upload\lib\debug
mkdir upload\bin\debug
mkdir upload\bin\release
mkdir upload\include
copy build\windows\x64\release\alt-voice.lib upload\lib\release
copy build\windows\x64\release\opus.lib upload\lib\release
copy build\windows\x64\release\rnnoise.lib upload\lib\release
copy build\windows\x64\release\bass.lib upload\lib\release
copy build\windows\x64\release\bass_fx.lib upload\lib\release
copy build\windows\x64\debug\alt-voice.lib upload\lib\debug
copy build\windows\x64\debug\opus.lib upload\lib\debug
copy build\windows\x64\debug\rnnoise.lib upload\lib\debug
copy build\windows\x64\debug\bass.lib upload\lib\debug
copy build\windows\x64\debug\bass_fx.lib upload\lib\debug
copy build\windows\x64\release\bass_fx.dll upload\bin\release
copy build\windows\x64\release\bass.dll upload\bin\release
copy build\windows\x64\debug\bass_fx.dll upload\bin\debug
copy build\windows\x64\debug\bass.dll upload\bin\debug
copy include\alt-voice.h upload\include
copy include\IAudioFilter.h upload\include
copy include\IOpusDecoder.h upload\include
copy include\IOpusEncoder.h upload\include
copy include\ISoundInput.h upload\include
copy include\ISoundOutput.h upload\include
copy include\VoiceError.h upload\include
- uses: actions/upload-artifact@v3
with:
name: alt-voice-windows
path: ./upload/
# build-linux:
# name: Build linux release
# runs-on: ubuntu-20.04
# steps:
# - name: Install XMake
# uses: xmake-io/github-action-setup-xmake@v1
# with:
# xmake-version: latest
# - name: Checkout repository
# uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: Build
# run: |
# xmake config -m release -y
# xmake build
# - name: Copy files
# run: |
# mkdir -p upload
# mkdir -p upload/lib
# mkdir -p upload/include
# cp ./build/linux/x64/release/alt-voice.a ./upload/lib
# cp ./include/alt-voice.h ./upload/include
# - uses: actions/upload-artifact@v3
# with:
# name: alt-voice-linux
# path: ./upload/
create-release:
name: Create GitHub Release
runs-on: ubuntu-20.04
# needs: [build-linux, build-windows]
needs: [build-windows]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download windows artifacts
uses: actions/download-artifact@v3
with:
name: alt-voice-windows
path: dist-windows
# - name: Download linux artifacts
# uses: actions/download-artifact@v3
# with:
# name: alt-voice-linux
# path: dist-linux
- name: Zip artifacts
run: |
cd dist-windows && zip -r ../alt-voice-windows.zip .
# zip -r alt-voice-linux dist-linux/*
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.vars.outputs.sha_short }}
release_name: Release @${{ steps.vars.outputs.sha_short }}
- name: Upload windows artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./alt-voice-windows.zip
asset_name: alt-voice-windows.zip
asset_content_type: application/zip
# - name: Upload linux artifacts
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./alt-voice-linux.zip
# asset_name: alt-voice-linux.zip
# asset_content_type: application/zip
delete-artifacts:
name: Delete artifacts
runs-on: ubuntu-20.04
needs: [ create-release ]
if: ${{ always() }}
steps:
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: |
alt-voice-windows
# alt-voice-linux