RWKV-Runner/.github/workflows/release.yml

139 lines
6.0 KiB
YAML
Raw Normal View History

2023-06-09 20:37:05 +08:00
name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
jobs:
create-draft:
2023-07-28 21:40:17 +08:00
runs-on: ubuntu-22.04
2023-06-09 20:37:05 +08:00
steps:
- run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
ref: master
- uses: jossef/action-set-json-field@v2.1
with:
file: manifest.json
field: version
value: ${{ env.VERSION }}
- continue-on-error: true
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "release ${{github.ref_name}}"
git push
- run: |
gh release create ${{github.ref_name}} -d -F CURRENT_CHANGE.md -t ${{github.ref_name}}
windows:
2023-07-28 21:40:17 +08:00
runs-on: windows-2022
2023-06-09 20:37:05 +08:00
needs: create-draft
steps:
- uses: actions/checkout@v3
2023-06-09 21:16:37 +08:00
with:
ref: master
2023-06-09 20:37:05 +08:00
- uses: actions/setup-go@v4
with:
go-version: '1.20.5'
- uses: actions/setup-python@v4
id: cp310
with:
python-version: '3.10'
- uses: crazy-max/ghaction-chocolatey@v2
with:
args: install upx
- run: |
2023-12-07 23:04:56 +08:00
Start-BitsTransfer https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_windows_x86_64.exe ./backend-rust/webgpu_server.exe
Start-BitsTransfer https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_windows_x86_64.exe ./backend-rust/web-rwkv-converter.exe
2023-12-06 23:08:20 +08:00
Start-BitsTransfer https://github.com/josStorer/LibreHardwareMonitor.Console/releases/latest/download/LibreHardwareMonitor.Console.zip ./LibreHardwareMonitor.Console.zip
2023-08-27 22:53:18 +08:00
Expand-Archive ./LibreHardwareMonitor.Console.zip -DestinationPath ./components/LibreHardwareMonitor.Console
2023-06-09 20:37:05 +08:00
Start-BitsTransfer https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip ./python-3.10.11-embed-amd64.zip
Expand-Archive ./python-3.10.11-embed-amd64.zip -DestinationPath ./py310
$content=Get-Content "./py310/python310._pth"; $content | ForEach-Object {if ($_.ReadCount -eq 3) {"Lib\\site-packages"} else {$_}} | Set-Content ./py310/python310._pth
./py310/python ./backend-python/get-pip.py
2023-10-25 17:07:40 +08:00
./py310/python -m pip install Cython==3.0.4
2023-06-09 20:37:05 +08:00
Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../include" -Destination "py310/include" -Recurse
Copy-Item -Path "${{ steps.cp310.outputs.python-path }}/../libs" -Destination "py310/libs" -Recurse
2023-10-25 17:07:40 +08:00
./py310/python -m pip install cyac==1.9
2023-06-09 20:37:05 +08:00
go install github.com/wailsapp/wails/v2/cmd/wails@latest
2023-12-12 20:29:55 +08:00
del ./backend-python/rwkv_pip/cpp/librwkv.dylib
del ./backend-python/rwkv_pip/cpp/librwkv.so
2023-08-27 23:56:30 +08:00
(Get-Content -Path ./backend-golang/app.go) -replace "//go:custom_build windows ", "" | Set-Content -Path ./backend-golang/app.go
2023-06-09 20:37:05 +08:00
make
Rename-Item -Path "build/bin/RWKV-Runner.exe" -NewName "RWKV-Runner_windows_x64.exe"
- run: gh release upload ${{github.ref_name}} build/bin/RWKV-Runner_windows_x64.exe
linux:
2023-07-01 19:32:58 +08:00
runs-on: ubuntu-20.04
2023-06-09 20:37:05 +08:00
needs: create-draft
steps:
- uses: actions/checkout@v3
2023-06-09 21:16:37 +08:00
with:
ref: master
2023-06-09 20:37:05 +08:00
- uses: actions/setup-go@v4
with:
go-version: '1.20.5'
- run: |
2023-12-08 19:22:01 +08:00
wget https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_linux_x86_64 -O ./backend-rust/webgpu_server
wget https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_linux_x86_64 -O ./backend-rust/web-rwkv-converter
2023-06-21 00:46:57 +08:00
sudo apt-get update
2023-06-09 20:37:05 +08:00
sudo apt-get install upx
2023-12-08 19:22:01 +08:00
sudo apt-get install build-essential libgtk-3-dev libwebkit2gtk-4.0-dev libasound2-dev
2023-06-09 20:37:05 +08:00
go install github.com/wailsapp/wails/v2/cmd/wails@latest
2023-10-03 14:04:46 +08:00
rm ./backend-python/rwkv_pip/wkv_cuda.pyd
rm ./backend-python/rwkv_pip/rwkv5.pyd
2023-11-24 17:55:16 +08:00
rm ./backend-python/rwkv_pip/rwkv6.pyd
rm ./backend-python/rwkv_pip/beta/wkv_cuda.pyd
2023-07-03 16:42:11 +08:00
rm ./backend-python/get-pip.py
2023-12-12 20:29:55 +08:00
rm ./backend-python/rwkv_pip/cpp/librwkv.dylib
rm ./backend-python/rwkv_pip/cpp/rwkv.dll
2023-06-09 20:37:05 +08:00
make
mv build/bin/RWKV-Runner build/bin/RWKV-Runner_linux_x64
- run: gh release upload ${{github.ref_name}} build/bin/RWKV-Runner_linux_x64
macos:
runs-on: macos-13
needs: create-draft
steps:
- uses: actions/checkout@v3
2023-06-09 21:16:37 +08:00
with:
ref: master
2023-06-09 20:37:05 +08:00
- uses: actions/setup-go@v4
with:
go-version: '1.20.5'
- run: |
2023-12-08 19:22:01 +08:00
wget https://github.com/josStorer/ai00_rwkv_server/releases/latest/download/webgpu_server_darwin_aarch64 -O ./backend-rust/webgpu_server
wget https://github.com/josStorer/web-rwkv-converter/releases/latest/download/web-rwkv-converter_darwin_aarch64 -O ./backend-rust/web-rwkv-converter
2023-06-09 20:37:05 +08:00
go install github.com/wailsapp/wails/v2/cmd/wails@latest
2023-10-03 14:04:46 +08:00
rm ./backend-python/rwkv_pip/wkv_cuda.pyd
rm ./backend-python/rwkv_pip/rwkv5.pyd
2023-11-24 17:55:16 +08:00
rm ./backend-python/rwkv_pip/rwkv6.pyd
rm ./backend-python/rwkv_pip/beta/wkv_cuda.pyd
2023-07-03 16:42:11 +08:00
rm ./backend-python/get-pip.py
2023-12-12 20:29:55 +08:00
rm ./backend-python/rwkv_pip/cpp/rwkv.dll
rm ./backend-python/rwkv_pip/cpp/librwkv.so
2023-06-09 20:37:05 +08:00
make
cp build/darwin/Readme_Install.txt build/bin/Readme_Install.txt
cp build/bin/RWKV-Runner.app/Contents/MacOS/RWKV-Runner build/bin/RWKV-Runner_darwin_universal
cd build/bin && zip -r RWKV-Runner_macos_universal.zip RWKV-Runner.app Readme_Install.txt
- run: gh release upload ${{github.ref_name}} build/bin/RWKV-Runner_macos_universal.zip build/bin/RWKV-Runner_darwin_universal
publish-release:
2023-07-28 21:40:17 +08:00
runs-on: ubuntu-22.04
2023-06-09 20:37:05 +08:00
needs: [ windows, linux, macos ]
steps:
2023-06-09 21:16:37 +08:00
- uses: actions/checkout@v3
2023-06-09 20:37:05 +08:00
- run: gh release edit ${{github.ref_name}} --draft=false