-
Notifications
You must be signed in to change notification settings - Fork 1
184 lines (155 loc) · 6.23 KB
/
release.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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: release
on:
workflow_dispatch:
inputs:
release_name:
description: "release page name"
required: true
cargo_update:
description: "update cargo"
required: false
default: "false"
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
build_ubuntu_2004_cuda12:
name: Build Ubuntu 20.04 cuda12
runs-on: ubuntu-latest
container: wasmedge/wasmedge:ubuntu-20.04-build-gcc-cuda12
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust-stable
uses: dtolnay/rust-toolchain@stable
- name: Install WasmEdge
run: |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- --version=0.14.1
- name: Install Torch
run: |
wget https://download.pytorch.org/libtorch/cu124/libtorch-cxx11-abi-shared-with-deps-2.4.0%2Bcu124.zip
unzip libtorch-cxx11-abi-shared-with-deps-2.4.0+cu124.zip
- name: Install gh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
type -p curl >/dev/null || (apt update && apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Cargo update
if: ${{ github.event.inputs.cargo_update == 'true' }}
run: |
cargo update
- name: Build
run: |
export LIBTORCH=$(pwd)/libtorch
cargo build --release
mv ./target/release/libgpt_sovits_plugin.so ./libgpt_sovits_plugin.ubuntu-2004.cuda12.so
- name: Create release page
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./libgpt_sovits_plugin.ubuntu-2004.cuda12.so
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to release page
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
gh release upload ${{ github.event.inputs.release_name }} ./libgpt_sovits_plugin.ubuntu-2004.cuda12.so --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_ubuntu_latest_cpu:
name: Build Ubuntu Latest CPU
runs-on: ubuntu-latest
container: wasmedge/wasmedge:ubuntu-20.04-build-gcc-cuda12
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust-stable
uses: dtolnay/rust-toolchain@stable
- name: Install WasmEdge
run: |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- --version=0.14.1
- name: Install Torch
run: |
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.4.0%2Bcpu.zip
unzip libtorch-cxx11-abi-shared-with-deps-2.4.0+cpu.zip
- name: Install gh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
type -p curl >/dev/null || (apt update && apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt update \
&& apt install gh -y
- name: Grant the safe directory for git
run: |
git config --global --add safe.directory $(pwd)
- name: Cargo update
if: ${{ github.event.inputs.cargo_update == 'true' }}
run: |
cargo update
- name: Build
run: |
export LIBTORCH=$(pwd)/libtorch
cargo build --release
mv ./target/release/libgpt_sovits_plugin.so ./libgpt_sovits_plugin.ubuntu-2004.cpu.so
- name: Create release page
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./libgpt_sovits_plugin.ubuntu-2004.cpu.so
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to release page
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
gh release upload ${{ github.event.inputs.release_name }} ./libgpt_sovits_plugin.ubuntu-2004.cpu.so --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_macos_cpu:
name : Build for MacOS
runs-on: macos-14
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust-stable
uses: dtolnay/rust-toolchain@stable
- name: Install WasmEdge
run: |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- --version=0.14.1
source $HOME/.wasmedge/env
- name: Install Torch
run: |
wget https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.4.0.zip
unzip libtorch-macos-arm64-2.4.0.zip
- name: Cargo update
if: ${{ github.event.inputs.cargo_update == 'true' }}
run: |
cargo update
- name: Build
run: |
export LIBTORCH=$(pwd)/libtorch
cargo build --release
mv ./target/release/libgpt_sovits_plugin.dylib ./libgpt_sovits_plugin.macos.cpu.dylib
- name: Create release page
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./libgpt_sovits_plugin.macos.cpu.dylib
token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to release page
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
gh release upload ${{ github.event.inputs.release_name }} ./libgpt_sovits_plugin.macos.cpu.dylib --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}