[v0.8.4] Android Support (plug & playback) #102
This file contains hidden or 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
| name: Publish to NuGet | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - "README.md" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Use .net9 SDK # Runner's SDK 10 doesn't build net8.0-android | |
| run: echo '{"sdk":{"version":"9.0.100","rollForward":"latestFeature"}}' > global.json | |
| - name: Install Android workload | |
| run: dotnet workload install android | |
| - name: Download Release Assets | |
| run: | | |
| mkdir -p release-assets | |
| curl -L -o release-assets/voices.zip https://github.com/Lyrcaxis/KokoroSharpBinaries/releases/download/v2.0.0/voices.zip | |
| curl -L -o release-assets/espeak.zip https://github.com/Lyrcaxis/KokoroSharpBinaries/releases/download/v2.0.0/espeak-ng-binaries-v1.52.zip | |
| unzip release-assets/voices.zip -d . | |
| unzip release-assets/espeak.zip -d . | |
| - name: Pack and build projects | |
| run: | | |
| PROJECTS=( | |
| "KokoroSharp.csproj" | |
| "./Runtimes/KokoroSharp.CPU.csproj" | |
| "./Runtimes/KokoroSharp.GPU.csproj" | |
| "./Runtimes/KokoroSharp.GPU.Linux.csproj" | |
| "./Runtimes/KokoroSharp.GPU.Windows.csproj" | |
| "./Runtimes/KokoroSharp.DirectML.csproj" | |
| "./Runtimes/KokoroSharp.Android.csproj" | |
| ) | |
| for project_path in "${PROJECTS[@]:1}"; do dotnet sln KokoroSharp.sln add "$project_path"; done # Add all projects to the solution | |
| for project_path in "${PROJECTS[@]}"; do dotnet pack "$project_path" -c Release -o ./packed_nupkgs; done # Pack all projects into nupkgs | |
| - name: Publish to NuGet | |
| run: dotnet nuget push ./packed_nupkgs/*.nupkg -k ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |