Skip to content

Update requirements #47

Update requirements

Update requirements #47

Workflow file for this run

name: build
on:
push:
branches:
- master
release:
types:
- created
workflow_dispatch:
inputs:
version:
description: "バージョン情報(A.BB.C / A.BB.C-preview.D)"
required: true
prerelease:
description: "プレリリースかどうか"
type: boolean
default: true
code_signing:
description: "コード署名する"
type: boolean
env:
PYTHON_VERSION: "3.11.3"
VOICEVOX_RESOURCE_VERSION: "0.14.3-preview.1"
VOICEVOX_CORE_VERSION: "0.14.4"
defaults:
run:
shell: bash
jobs:
config: # 全 jobs で利用する定数の定義. `env` が利用できないコンテキストでも利用できる.
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.version }}
version_or_latest: ${{ steps.vars.outputs.version_or_latest }}
steps:
- name: declare variables
id: vars
run: |
: # release タグ名, または workflow_dispatch でのバージョン名. リリースでない (push event) 場合は空文字列
echo "version=${{ github.event.release.tag_name || github.event.inputs.version }}" >> $GITHUB_OUTPUT
: # release タグ名, または workflow_dispatch でのバージョン名, または 'latest'
echo "version_or_latest=${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}" >> $GITHUB_OUTPUT
build-all:
needs: [config]
environment: ${{ github.event.inputs.code_signing == 'true' && 'code_signing' || '' }} # コード署名用のenvironment
strategy:
matrix:
include:
# Windows CPU
- os: windows-2019
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
ccache_url: https://github.com/ccache/ccache/releases/download/v4.4.1/ccache-4.4.1-windows-64.zip
nuitka_cache_path: nuitka_cache
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
# 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
# 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
# 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
# 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
# target: linux-nvidia
runs-on: ${{ matrix.os }}
steps:
- name: declare variables
id: vars
run: |
echo "artifact_name=bridge_plugin-${{ matrix.target }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: Show disk space (debug info)
run: |
df -h
# NOTE: The default sed of macOS is BSD sed.
# There is a difference in specification between BSD sed and GNU sed,
# so you need to install GNU sed.
#- name: Install GNU sed on macOS
# if: startsWith(matrix.os, 'macos-')
# shell: bash
# run: brew install gnu-sed
# ONNX Runtime providersとCUDA周りをリンクするために使う
#- name: Install patchelf
# if: startsWith(matrix.os, 'ubuntu-') && endsWith(matrix.target, 'nvidia')
# run: |
# sudo apt-get update
# sudo apt-get install -y patchelf
# Download CUDA
#- name: Prepare CUDA DLL cache
# if: matrix.cuda_version != ''
# uses: actions/cache@v3
# id: cuda-dll-cache
# with:
# # update this key when ONNX Runtime CUDA dependency changed
# key: ${{ matrix.os }}-cuda-dll-${{ matrix.cuda_version }}-v1
# path: download/cuda
#- name: Setup CUDA
# if: matrix.cuda_version != '' && steps.cuda-dll-cache.outputs.cache-hit != 'true'
# uses: Jimver/cuda-toolkit@v0.2.8
# id: cuda-toolkit
# with:
# method: network
# cuda: ${{ matrix.cuda_version }}
#- name: Extract CUDA Dynamic Libraries
# if: matrix.cuda_version != '' && steps.cuda-dll-cache.outputs.cache-hit != 'true'
# shell: bash
# run: |
# set -eux
# CUDA_ROOT=$( echo "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}" | tr '\\' '/' )
# mkdir -p download/cuda/bin
# if [[ ${{ matrix.os }} == windows-* ]]; then
# mv "${CUDA_ROOT}/bin/"*.dll download/cuda/bin/
# rm -rf "${CUDA_ROOT}"
# else
# cp "${CUDA_ROOT}/lib64/"libcublas.so.* download/cuda/bin/
# cp "${CUDA_ROOT}/lib64/"libcublasLt.so.* download/cuda/bin/
# cp "${CUDA_ROOT}/lib64/"libcudart.so.* download/cuda/bin/
# cp "${CUDA_ROOT}/lib64/"libcufft.so.* download/cuda/bin/
# cp "${CUDA_ROOT}/lib64/"libcurand.so.* download/cuda/bin/
# # remove unneed full version libraries
# rm -f download/cuda/bin/libcublas.so.*.*
# rm -f download/cuda/bin/libcublasLt.so.*.*
# rm -f download/cuda/bin/libcufft.so.*.*
# rm -f download/cuda/bin/libcurand.so.*.*
# rm -f download/cuda/bin/libcudart.so.*.*.*
# fi
#- name: Show disk space (debug info)
# if: matrix.cuda_version != ''
# shell: bash
# run: |
# df -h
## Download cuDNN
#- name: Export cuDNN url to calc hash
# if: matrix.cudnn_url != ''
# shell: bash
# run: echo "${{ matrix.cudnn_url }}" > download/cudnn_url.txt
#- name: Prepare cuDNN cache
# if: matrix.cudnn_url != ''
# uses: actions/cache@v3
# id: cudnn-dll-cache
# with:
# # update this key when ONNX Runtime cuDNN dependency changed
# key: ${{ matrix.os }}-cudnn-dll-${{ hashFiles('download/cudnn_url.txt') }}-v1
# path: download/cudnn
#- name: Download and extract cuDNN Dynamic Libraries
# if: matrix.cudnn_url != '' && steps.cudnn-dll-cache.outputs.cache-hit != 'true'
# shell: bash
# run: |
# set -eux
# if [[ ${{ matrix.os }} == windows-* ]]; then
# curl -L "${{ matrix.cudnn_url }}" > download/cudnn.zip
# unzip download/cudnn.zip cudnn-*/bin/*.dll -d download/cudnn_tmp
# mkdir -p download/cudnn/bin
# mv download/cudnn_tmp/cudnn-*/bin/*.dll download/cudnn/bin/
# rm -rf download/cudnn_tmp
# rm download/cudnn.zip
# else
# curl -L "${{ matrix.cudnn_url }}" > download/cudnn.tar.xz
# tar -Jxf download/cudnn.tar.xz -C download/
# mkdir -p download/cudnn/bin
# cp download/cudnn-*/lib/libcudnn.so.* download/cudnn/bin/
# cp download/cudnn-*/lib/libcudnn_*_infer.so.* download/cudnn/bin/
# # remove unneed full version libraries
# rm -f download/cudnn/bin/libcudnn.so.*.*
# rm -f download/cudnn/bin/libcudnn_*_infer.so.*.*
# rm download/cudnn.tar.xz
# fi
- name: Show disk space (debug info)
if: matrix.cudnn_url != ''
run: |
df -h
- name: Setup MSVC
if: startsWith(matrix.os, 'windows-')
uses: ilammy/msvc-dev-cmd@v1
# Python install path of windows: C:/hostedtoolcache/windows/Python
- name: Setup Python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
architecture: ${{ matrix.architecture }}
cache: pip
- name: Install Python dependencies
run: |
python -m pip install -r requirements-dev.txt
# Download pyopenjtalk dictionary
# try 5 times, sleep 5 seconds before retry
for i in $(seq 5); do
EXIT_CODE=0
python3 -c "import pyopenjtalk; pyopenjtalk._lazy_init()" || EXIT_CODE=$?
if [ "$EXIT_CODE" = "0" ]; then
break
fi
sleep 5
done
if [ "$EXIT_CODE" != "0" ]; then
exit "$EXIT_CODE"
fi
- name: Create download directory
run: mkdir -p download/
# Install Ccache
- name: Export Ccache url to calc hash
if: startsWith(matrix.os, 'windows-')
run: echo "${{ matrix.ccache_url }}" > download/ccache_url.txt
- name: Prepare Ccache
if: startsWith(matrix.os, 'windows-')
uses: actions/cache@v3
id: ccache-cache
with:
key: ${{ matrix.os }}-ccache-${{ hashFiles('download/ccache_url.txt') }}
path: download/ccache
- name: Download Ccache
if: startsWith(matrix.os, 'windows-') && steps.ccache-cache.outputs.cache-hit != 'true'
run: |
curl -L "${{ matrix.ccache_url }}" > download/ccache.zip
unzip download/ccache.zip -d download/
rm download/ccache.zip
mv download/ccache-*/ download/ccache
- name: Install Ccache
if: startsWith(matrix.os, 'windows-')
run: |
echo "$HOME/download/ccache" >> $GITHUB_PATH
# Donwload DirectML
#- name: Export DirectML url to calc hash
# if: endswith(matrix.target, '-directml')
# shell: bash
# run: echo "${{ matrix.directml_url }}" >> download/directml_url.txt
#- name: Cache 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.target, '-directml')
# shell: bash
# run: |
# curl -L "${{ matrix.directml_url }}" -o download/directml.zip
# mkdir -p download/directml
# # extract only dlls
# unzip download/directml.zip bin/${{ matrix.architecture }}-win/DirectML.dll -d download/directml
# rm download/directml.zip
# mv download/directml/bin/${{ matrix.architecture }}-win/DirectML.dll download/directml/DirectML.dll
# rm -r download/directml/bin
# Download ONNX Runtime
#- name: Export ONNX Runtime url to calc hash
# shell: bash
# run: echo "${{ matrix.onnxruntime_url }}" > download/onnxruntime_url.txt
#- name: Prepare ONNX Runtime cache
# uses: actions/cache@v3
# id: onnxruntime-cache
# with:
# key: ${{ matrix.os }}-onnxruntime-${{ hashFiles('download/onnxruntime_url.txt') }}-v1
# path: download/onnxruntime
#- name: Download ONNX Runtime (Windows)
# if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows-')
# shell: bash
# run: |
# curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip
# # extract only dlls
# if [[ ${{ matrix.target }} != *-directml ]]; then
# unzip download/onnxruntime.zip onnxruntime-*/lib/*.dll -d download/
# mv download/onnxruntime-* download/onnxruntime
# else
# mkdir -p download/onnxruntime/lib
# unzip download/onnxruntime.zip runtimes/win-${{ matrix.architecture }}/native/*.dll -d download/onnxruntime
# mv download/onnxruntime/runtimes/win-${{ matrix.architecture }}/native/*.dll download/onnxruntime/lib/
# rm -r download/onnxruntime/runtimes
# fi
# rm download/onnxruntime.zip
#- name: Download ONNX Runtime (Mac/Linux)
# if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && startsWith(matrix.os, 'windows-') != true
# shell: bash
# run: |
# curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.tgz
# mkdir -p download/onnxruntime
# tar xf "download/onnxruntime.tgz" -C "download/onnxruntime" --strip-components 1
# rm download/onnxruntime.tgz
- name: Show disk space (debug info)
run: |
df -h
# Download VOICEVOX RESOURCE
#- name: Prepare VOICEVOX RESOURCE cache
# uses: actions/cache@v3
# id: voicevox-resource-cache
# with:
# key: voicevox-resource-${{ env.VOICEVOX_RESOURCE_VERSION }}
# path: download/resource
#- name: Checkout VOICEVOX RESOURCE
# if: steps.voicevox-resource-cache.outputs.cache-hit != 'true'
# uses: actions/checkout@v3
# with:
# repository: VOICEVOX/voicevox_resource
# ref: ${{ env.VOICEVOX_RESOURCE_VERSION }}
# path: download/resource
# Merge VOICEVOX RESOURCE
#- name: Merge VOICEVOX RESOURCE
# shell: bash
# env:
# DOWNLOAD_RESOURCE_PATH: download/resource
# run: bash build_util/process_voicevox_resource.bash
# Download VOICEVOX Core
#- name: Prepare VOICEVOX Core cache
# uses: actions/cache@v3
# id: voicevox-core-cache
# with:
# key: ${{ matrix.os }}-voicevox-core-${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
# path: download/core
#- name: Download VOICEVOX Core
# if: steps.voicevox-core-cache.outputs.cache-hit != 'true'
# shell: bash
# env:
# VOICEVOX_CORE_ASSET_NAME: ${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
# run: |
# curl -L "https://github.com/VOICEVOX/voicevox_core/releases/download/${{ env.VOICEVOX_CORE_VERSION }}/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip" > download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
# # NOTE: Windows 版コアのみ PowerShell の Compress-Archive コマンドレットを用いて zip を作成している(デフォルト状態では zip コマンドが存在していないため)。
# # このコマンドはバージョンによっては作成した zip 内のパスの区切り文字がバックスラッシュになる。 (cf. https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/48)
# # unzip コマンドはこのような zip ファイルを解凍できるものの、終了コード 1 を報告して CI が落ちてしまう。
# # 回避策として、unzip コマンドの代わりに 7z コマンドを用いて zip ファイルを解凍する。
# # unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/
# if [[ ${{ matrix.os }} == windows-* ]]; then
# 7z x -o"download" download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
# elif [[ ${{ matrix.os }} == mac-* ]]; then
# ditto -x -k --sequesterRsrc --rsrc download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip download/
# else
# unzip download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip -d download/
# fi
# mkdir -p download/core
# mv download/${{ env.VOICEVOX_CORE_ASSET_NAME }}/* download/core
# rm -rf download/${{ env.VOICEVOX_CORE_ASSET_NAME }}
# rm download/${{ env.VOICEVOX_CORE_ASSET_NAME }}.zip
#- name: Copy VOICEVOX Core Models
# shell: bash
# run: |
# cp -r download/core/model ./
- name: Generate licenses.json
run: |
OUTPUT_LICENSE_JSON_PATH=engine_manifest_assets/dependency_licenses.json \
bash build_util/create_venv_and_generate_licenses.bash
# FIXME: VOICEVOX (editor) cannot build without licenses.json
cp engine_manifest_assets/dependency_licenses.json licenses.json
- name: Cache Nuitka (ccache, module-cache)
if: startsWith(matrix.os, 'windows-')
uses: actions/cache@v3
id: nuitka-cache
with:
path: ${{ matrix.nuitka_cache_path }}
key: ${{ runner.os }}-nuitka-${{ matrix.artifact_name }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-nuitka-${{ matrix.artifact_name }}-
- name: Show disk space (debug info)
run: |
df -h
- name: Build run.py with nuitka
env:
NUITKA_CACHE_DIR: ${{ matrix.nuitka_cache_path }}
run: |
set -eux
# workaround for nuitka
# https://github.com/ilammy/msvc-dev-cmd#name-conflicts-with-shell-bash
if [[ ${{ matrix.os }} == windows-* ]]; then
rm /usr/bin/link
fi
jq '.version = "${{ needs.config.outputs.version_or_latest }}"' engine_manifest.json > engine_manifest.json.tmp
mv -f engine_manifest.json.tmp engine_manifest.json
# Replace version & specify dynamic libraries
if [[ ${{ matrix.os }} == macos-* ]]; then
gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version_or_latest }}\"/" voicevox_engine/__init__.py
else
sed -i "s/__version__ = \"latest\"/__version__ = \"${{ needs.config.outputs.version_or_latest }}\"/" voicevox_engine/__init__.py
fi
python -m nuitka \
--standalone \
--assume-yes-for-downloads \
--follow-import-to=numpy \
--follow-import-to=aiofiles \
--include-package=uvicorn \
--include-package=anyio \
--include-package-data=pyopenjtalk \
--include-package-data=scipy \
--nofollow-import-to=sklearn \
--nofollow-import-to=torchvision \
--nofollow-import-to=torchaudio \
--nofollow-import-to=distance \
--nofollow-import-to=unidecode \
--nofollow-import-to=numba \
--include-data-file="licenses.json=./" \
--include-data-file="presets.yaml=./" \
--include-data-file="default.csv=./" \
--include-data-file="engine_manifest.json=./" \
--include-data-file="default_setting.yml=./" \
--include-data-dir="speaker_info=./speaker_info" \
--include-data-dir="engine_manifest_assets=./engine_manifest_assets" \
--msvc=14.3 \
--follow-imports \
--no-prefer-source-code \
--user-package-configuration-file="nuitka-config.yaml" \
run.py
- name: Show disk space (debug info)
run: |
df -h
- name: Create artifact directory with symlink
if: startsWith(matrix.os, 'windows-')
env:
PYTHON_SITE_PACKAGES_DIR: C:/hostedtoolcache/windows/python/${{ steps.setup-python.outputs.python-version }}/x64/lib/site-packages
# # create symlink instead of copy (Git Bash)
# # https://qiita.com/ucho/items/c5ea0beb8acf2f1e4772
MSYS: winsymlinks:nativestrict
run: |
set -eux
# Build artifact directory
mkdir -p artifact
ln -sf "$(pwd)/run.dist"/* artifact/
# # Copy DLL dependencies
# if [ -f "download/onnxruntime/lib/onnxruntime_providers_cuda.dll" ]; then
# # ONNX Runtime providers (PyInstaller does not copy dynamic loaded libraries)
# ln -sf "$(pwd)/download/onnxruntime/lib"/onnxruntime_*.dll dist/run/
# # CUDA
# ln -sf "$(pwd)/download/cuda/bin"/cublas64_*.dll dist/run/
# ln -sf "$(pwd)/download/cuda/bin"/cublasLt64_*.dll dist/run/
# ln -sf "$(pwd)/download/cuda/bin"/cudart64_*.dll dist/run/
# ln -sf "$(pwd)/download/cuda/bin"/cufft64_*.dll dist/run/
# ln -sf "$(pwd)/download/cuda/bin"/curand64_*.dll dist/run/
# # cuDNN
# ln -sf "$(pwd)/download/cudnn/bin"/cudnn64_*.dll dist/run/
# ln -sf "$(pwd)/download/cudnn/bin"/cudnn_*_infer64*.dll dist/run/
# fi
# 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.target, 'nvidia')
# shell: bash
# run: |
# set -eux
# # ONNX Runtime providers (PyInstaller does not copy dynamic loaded libraries)
# patchelf --set-rpath '$ORIGIN' "$(pwd)/download/onnxruntime/lib"/libonnxruntime_providers_*.so
# ln -sf "$(pwd)/download/onnxruntime/lib"/libonnxruntime_*.so dist/run/
# # CUDA
# ln -sf "$(pwd)/download/cuda/bin"/libcublas.so.* dist/run/
# ln -sf "$(pwd)/download/cuda/bin"/libcublasLt.so.* dist/run/
# ln -sf "$(pwd)/download/cuda/bin"/libcudart.so.* dist/run/
# ln -sf "$(pwd)/download/cuda/bin"/libcufft.so.* dist/run/
# ln -sf "$(pwd)/download/cuda/bin"/libcurand.so.* dist/run/
# # cuDNN
# ln -sf "$(pwd)/download/cudnn/bin"/libcudnn.so.* dist/run/
# ln -sf "$(pwd)/download/cudnn/bin"/libcudnn_*_infer.so.* dist/run/
#- name: Set @rpath to @executable_path
# if: startsWith(matrix.os, 'macos-')
# run: |
# install_name_tool -add_rpath @executable_path/. dist/run/run
#- name: Code signing
# if: github.event.inputs.code_signing == 'true' && startsWith(matrix.os, 'windows-')
# shell: bash
# run: |
# bash build_util/codesign.bash "dist/run/run.exe"
# env:
# CERT_BASE64: ${{ secrets.CERT_BASE64 }}
# CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.vars.outputs.artifact_name }}
path: artifact/
upload-to-release:
if: needs.config.outputs.version != ''
needs: [config, build-all]
runs-on: ubuntu-latest
strategy:
matrix:
target:
#- macos-x64
#- linux-cpu
#- linux-nvidia
- windows-cpu
#- windows-directml
#- windows-nvidia
steps:
- name: declare variables
id: vars
run: |
echo "package_name=bridge_plugin-${{ 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=bridge_plugin-${{ matrix.target }}-${{ needs.config.outputs.version_or_latest }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
p7zip-full
- name: Download and extract artifact
uses: actions/download-artifact@v3
with:
name: ${{ steps.vars.outputs.artifact_name }}
path: ${{ matrix.target }}/
- name: Rearchive and split artifact
run: |
# Compress to artifact.7z.001, artifact.7z.002, ...
7z -r -v1900m a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.target }}/"
# Compress to artifact.001.vvpp,artifact.002.vvpp, ...
(cd "${{ matrix.target }}" && zip -r - . > ../compressed.zip)
split -b 1900M --numeric-suffixes=1 -a 3 --additional-suffix .vvppp ./compressed.zip ./${{ steps.vars.outputs.package_name }}.
# Rename to artifact.vvpp if there are only artifact.001.vvpp
if [ "$(ls ${{ steps.vars.outputs.package_name }}.*.vvpp | wc -l)" == 1 ]; then
mv ${{ steps.vars.outputs.package_name }}.001.vvpp ${{ steps.vars.outputs.package_name }}.vvpp
fi
# Output splitted archive list
ls ${{ steps.vars.outputs.package_name }}.7z.* > archives_7z.txt
mv archives_7z.txt "${{ steps.vars.outputs.package_name }}.7z.txt"
ls ${{ steps.vars.outputs.package_name }}*.vvpp > archives_vvpp.txt
mv archives_vvpp.txt "${{ steps.vars.outputs.package_name }}.vvpp.txt"
- name: Upload splitted archives to Release assets
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ github.event.inputs.prerelease }}
tag_name: ${{ needs.config.outputs.version }}
files: |-
${{ steps.vars.outputs.package_name }}.7z.*
target_commitish: ${{ github.sha }}
#run-release-test-workflow:
# if: needs.config.outputs.version != ''
# needs: [config, upload-to-release]
# uses: ./.github/workflows/release-test.yml
# with:
# version: ${{ needs.config.outputs.version }}
# repo_url: ${{ format('{0}/{1}', github.server_url, github.repository) }} # このリポジトリのURL