.github/workflows/release.yml #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version Number' | |
default: '0.0.0.0' | |
required: true | |
type: string | |
create-release: | |
type: boolean | |
description: "Create Release" | |
jobs: | |
release: | |
runs-on: ${{ matrix.os.runs-on }} | |
strategy: | |
matrix: | |
os: | |
- runs-on: windows-latest | |
arch: win-x64 | |
- runs-on: macos-latest | |
arch: osx-x64 | |
- runs-on: ubuntu-latest | |
arch: linux-x64 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Patch Versions | |
uses: justalemon/VersionPatcher@v0.7.1 | |
with: | |
version: ${{ inputs.version }} | |
csproj-files: "OpenUtau/*.csproj" | |
- name: restore x64 | |
run: dotnet restore OpenUtau -r ${{ matrix.os.arch }} | |
- name: build x64 | |
run: dotnet publish OpenUtau -c Release -r ${{ matrix.os.arch }} --self-contained true -o bin/${{ matrix.os.arch }} | |
- name: add openutau.plugins.builtin (windows) | |
if: ${{ matrix.os.arch == 'win-x64' }} | |
run: copy OpenUtau.Plugin.Builtin\bin\Release\netstandard2.1\OpenUtau.Plugin.Builtin.dll -Destination bin\${{ matrix.os.arch }} | |
- name: add openutau.plugins.builtin (macos and linux) | |
if: ${{ matrix.os.arch == 'osx-x64' || matrix.os.arch == 'linux-x64' }} | |
run: cp OpenUtau.Plugin.Builtin/bin/Release/netstandard2.1/OpenUtau.Plugin.Builtin.dll bin/${{ matrix.os.arch }} | |
#手动添加directml.dll的临时方案 | |
- name: add directml.dll (windows) | |
if: ${{ matrix.os.arch == 'win-x64' }} | |
uses: carlosperate/download-file-action@v1.0.3 | |
with: | |
file-url: https://github.com/xunmengshe/OpenUtau/releases/download/0.0.0.1/DirectML.dll | |
file-name: DirectML.dll | |
location: ./bin/${{ matrix.os.arch }}/ | |
- name: compress x64 | |
run: 7z a OpenUtau-${{ matrix.os.arch }}-${{ inputs.version }}.zip ./bin/${{ matrix.os.arch }}/* | |
- name: download vocoder | |
uses: carlosperate/download-file-action@v1.0.3 | |
with: | |
file-url: https://github.com/xunmengshe/OpenUtau/releases/download/0.0.0.0/nsf_hifigan.oudep | |
file-name: nsf_hifigan.oudep | |
location: ./ | |
- name: extract vocoder | |
run: 7z x -o"./bin/${{ matrix.os.arch }}/Dependencies/nsf_hifigan" ./nsf_hifigan.oudep | |
- name: download rhythmizer | |
uses: carlosperate/download-file-action@v1.0.3 | |
with: | |
file-url: https://github.com/xunmengshe/OpenUtau/releases/download/0.0.0.0/rhythmizer_zh_opencpop_strict.oudep | |
file-name: rhythmizer_zh_opencpop_strict.oudep | |
location: ./ | |
- name: extract rhythmizer | |
run: 7z x -o"./bin/${{ matrix.os.arch }}/Dependencies/rhythmizer_zh_opencpop_strict" ./rhythmizer_zh_opencpop_strict.oudep | |
- name: compress x64 DiffsingerPack | |
if: ${{ matrix.os.arch == 'win-x64' }} | |
run: 7z a OpenUtau-${{ matrix.os.arch }}-${{ inputs.version }}-DiffsingerPack.zip ./bin/${{ matrix.os.arch }}/* | |
- name: Upload artifact x64 | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: OpenUtau-${{ matrix.os.arch }}-${{ inputs.version }}.zip | |
path: OpenUtau-${{ matrix.os.arch }}-${{ inputs.version }}.zip | |
- name: Upload artifact x64 DiffsingerPack | |
if: ${{ matrix.os.arch == 'win-x64' }} | |
uses: actions/upload-artifact@v1.0.0 | |
with: | |
name: OpenUtau-${{ matrix.os.arch }}-${{ inputs.version }}-DiffsingerPack.zip | |
path: OpenUtau-${{ matrix.os.arch }}-${{ inputs.version }}-DiffsingerPack.zip | |
- name: Create release and upload artifact | |
if: ${{ inputs.create-release }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ inputs.version }} | |
files: | | |
OpenUtau-${{ matrix.os.arch }}-${{ inputs.version }}.zip | |
- name: Create release and upload artifact DiffsingerPack | |
if: ${{ inputs.create-release && matrix.os.arch == 'win-x64' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ inputs.version }} | |
files: | | |
OpenUtau-${{ matrix.os.arch }}-${{ inputs.version }}-DiffsingerPack.zip |