Skip to content

Commit

Permalink
matrix.artifact_name -> matrix.target
Browse files Browse the repository at this point in the history
  • Loading branch information
sarisia committed Dec 29, 2022
1 parent 3a29482 commit 685ffc1
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,42 +51,42 @@ jobs:
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-win-x64-1.13.1.zip
artifact_name: windows-cpu
target: windows-cpu
# Windows DirectML
- os: windows-2019
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-directml
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/Microsoft.ML.OnnxRuntime.DirectML.1.13.1.zip
directml_url: https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.10.0
artifact_name: windows-directml
target: windows-directml
# Windows NVIDIA GPU
- os: windows-2019
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-cuda
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-win-x64-gpu-1.13.1.zip
cuda_version: "11.6.2"
cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.4.1/local_installers/11.6/cudnn-windows-x86_64-8.4.1.50_cuda11.6-archive.zip
artifact_name: windows-nvidia
target: windows-nvidia
# Mac CPU (x64 arch only)
- os: macos-11
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-osx-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-osx-x86_64-1.13.1.tgz
artifact_name: macos-x64
target: macos-x64
# Linux CPU
- os: ubuntu-20.04
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-1.13.1.tgz
artifact_name: linux-cpu
target: linux-cpu
# Linux NVIDIA GPU
- os: ubuntu-20.04
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-linux-x64-gpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.13.1/onnxruntime-linux-x64-gpu-1.13.1.tgz
cuda_version: "11.6.2"
cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.4.1/local_installers/11.6/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz
artifact_name: linux-nvidia
target: linux-nvidia

runs-on: ${{ matrix.os }}

Expand All @@ -95,7 +95,7 @@ jobs:
id: vars
shell: bash
run: |
echo "artifact_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT
echo "artifact_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3

Expand All @@ -114,7 +114,7 @@ jobs:

# ONNX Runtime providersとCUDA周りをリンクするために使う
- name: Install patchelf
if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.artifact_name, 'nvidia')
if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia')
run: |
sudo apt-get update
sudo apt-get install -y patchelf
Expand Down Expand Up @@ -265,20 +265,20 @@ jobs:

# Donwload DirectML
- name: Export DirectML url to calc hash
if: endswith(matrix.artifact_name, '-directml')
if: endswith(matrix.target, '-directml')
shell: bash
run: echo "${{ matrix.directml_url }}" >> download/directml_url.txt

- name: Cache DirectML
if: endswith(matrix.artifact_name, '-directml')
if: endswith(matrix.target, '-directml')
uses: actions/cache@v3
id: directml-cache
with:
key: directml-cache-v1-${{ hashFiles('download/directml_url.txt') }}
path: download/directml

- name: Download DirectML
if: steps.directml-cache.outputs.cache-hit != 'true' && endswith(matrix.artifact_name, '-directml')
if: steps.directml-cache.outputs.cache-hit != 'true' && endswith(matrix.target, '-directml')
shell: bash
run: |
curl -L "${{ matrix.directml_url }}" -o download/directml.zip
Expand Down Expand Up @@ -309,7 +309,7 @@ jobs:
curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip
# extract only dlls
if [[ ${{ matrix.artifact_name }} != *-directml ]]; then
if [[ ${{ matrix.target }} != *-directml ]]; then
unzip download/onnxruntime.zip onnxruntime-*/lib/*.dll -d download/
mv download/onnxruntime-* download/onnxruntime
else
Expand Down Expand Up @@ -461,13 +461,13 @@ jobs:
ln -sf "$(pwd)/download/cudnn/bin"/cudnn_*_infer64*.dll dist/run/
fi
if [[ ${{ matrix.artifact_name }} == *-directml ]]; then
if [[ ${{ matrix.target }} == *-directml ]]; then
# DirectML
ln -sf "$(pwd)/download/directml"/DirectML.dll dist/run/
fi
- name: Create symlink of CUDA dependencies
if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.artifact_name, 'nvidia')
if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia')
shell: bash
run: |
set -eux
Expand Down Expand Up @@ -513,7 +513,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
artifact_name:
target:
- macos-x64
- linux-cpu
- linux-nvidia
Expand All @@ -525,10 +525,10 @@ jobs:
id: vars
shell: bash
run: |
echo "package_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT
echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> $GITHUB_OUTPUT
: # this is exactly same as `steps.vars.outputs.artifact_name` in `build-all` job,
: # but since we cannot get the job outputs of matrix builds correctly, we need to redefine here.
echo "artifact_name=voicevox_engine-${{ matrix.artifact_name }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT
echo "artifact_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3

Expand All @@ -542,15 +542,15 @@ jobs:
uses: actions/download-artifact@v3
with:
name: ${{ steps.vars.outputs.artifact_name }}
path: ${{ matrix.artifact_name }}/
path: ${{ matrix.target }}/

- name: Rearchive and split artifact
run: |
# Compress to artifact.7z.001, artifact.7z.002, ...
7z -r -v2g a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.artifact_name }}/"
7z -r -v2g a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.target }}/"
# Compress to artifact.001.vvpp,artifact.002.vvpp, ...
(cd "${{ matrix.artifact_name }}" && zip -r - . > ../compressed.zip)
(cd "${{ matrix.target }}" && zip -r - . > ../compressed.zip)
split -b 2G --numeric-suffixes=1 -a 3 --additional-suffix .vvpp ./compressed.zip ./${{ steps.vars.outputs.package_name }}.
# Rename to artifact.vvpp if there are only artifact.001.vvpp
Expand Down

0 comments on commit 685ffc1

Please sign in to comment.