From 97175773a8f7903beaf36994157924ce88c2cd88 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sat, 24 Aug 2024 16:28:23 +0900 Subject: [PATCH] =?UTF-8?q?add:=20voicevox=5Fonnxruntime=E3=82=92=E3=83=93?= =?UTF-8?q?=E3=83=AB=E3=83=89=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 224 +++++++++++++++++++++++++----------- 1 file changed, 159 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49014ce..3b9c958 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,25 +2,37 @@ name: Build C++ Shared Library on: push: - release: - types: - - published workflow_dispatch: inputs: version: description: "バージョン情報(A.BB.C / A.BB.C-preview.D)" required: true + name: + description: "名前" + type: choice + default: onnxruntime + options: + - onnxruntime + - voicevox_onnxruntime release: description: "リリースするかどうか" type: boolean + code_signing: + description: "コード署名する" + type: boolean + required: false + default: false env: + ONNXRUNTIME_NAME: + |- + ${{ inputs.name || 'onnxruntime' }} ONNXRUNTIME_VERSION: - |- # releaseタグ名か、workflow_dispatchでのバージョン名が入る。無指定なら適当なバージョン - ${{ github.event.release.tag_name || github.event.inputs.version || '1.17.3' }} + |- # workflow_dispatchでのバージョン名が入る。無指定なら適当なバージョン + ${{ github.event.inputs.version || '1.17.3' }} RELEASE: - |- # releaseタグ名か、workflow_dispatchでのreleaseフラグがあればリリースする - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} + |- # workflow_dispatchでのreleaseフラグがあればリリースする + ${{ github.event.inputs.release == 'true' }} defaults: run: @@ -33,16 +45,17 @@ jobs: matrix: # TODO: 外せる`--compile_no_warning_as_error`は外す include: - - artifact_name: onnxruntime-win-x64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-win-x64 os: windows-2022 build_opts: |- --compile_no_warning_as_error --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 + Rust_CARGO_TARGET=x86_64-pc-windows-msvc result_dir: build/Release release_config: Release - - artifact_name: onnxruntime-win-x64-dml + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-win-x64-dml os: windows-2022 build_opts: |- --compile_no_warning_as_error @@ -50,9 +63,10 @@ jobs: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 + Rust_CARGO_TARGET=x86_64-pc-windows-msvc result_dir: build/Release release_config: Release - - artifact_name: onnxruntime-win-x64-cuda + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-win-x64-cuda os: windows-2022 cuda_version: 12.4.1 # Windowsの場合デフォルトのパッケージ群では不十分であるため、必要そうなパッケージを指定する。ただしいくつかは不要かもしれない @@ -65,9 +79,10 @@ jobs: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86_64 + Rust_CARGO_TARGET=x86_64-pc-windows-msvc result_dir: build/Release release_config: Release - - artifact_name: onnxruntime-win-x86 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-win-x86 os: windows-2022 build_opts: |- --compile_no_warning_as_error @@ -75,18 +90,20 @@ jobs: --cmake_extra_defines CMAKE_SYSTEM_NAME=Windows CMAKE_SYSTEM_PROCESSOR=x86 + Rust_CARGO_TARGET=i686-pc-windows-msvc result_dir: build/Release release_config: Release - - artifact_name: onnxruntime-linux-x64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-linux-x64 os: ubuntu-20.04 build_opts: |- --compile_no_warning_as_error --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=x86_64 + Rust_CARGO_TARGET=x86_64-unknown-linux-gnu result_dir: build release_config: Release - - artifact_name: onnxruntime-linux-x64-cuda + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-linux-x64-cuda os: ubuntu-20.04 cuda_version: 12.4.1 cuda_sub_packages: "[]" # デフォルト @@ -97,9 +114,10 @@ jobs: --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=x86_64 + Rust_CARGO_TARGET=x86_64-unknown-linux-gnu result_dir: build release_config: Release - - artifact_name: onnxruntime-linux-armhf + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-linux-armhf os: ubuntu-20.04 cc_version: "10" cxx_version: "10" @@ -111,9 +129,10 @@ jobs: --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=armv7l + Rust_CARGO_TARGET=armv7-unknown-linux-gnueabihf result_dir: build release_config: Release - - artifact_name: onnxruntime-linux-arm64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-linux-arm64 os: ubuntu-20.04 cc_version: "10" cxx_version: "10" @@ -125,27 +144,30 @@ jobs: --cmake_extra_defines CMAKE_SYSTEM_NAME=Linux CMAKE_SYSTEM_PROCESSOR=aarch64 + Rust_CARGO_TARGET=aarch64-unknown-linux-gnu result_dir: build release_config: Release - - artifact_name: onnxruntime-osx-arm64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-osx-arm64 os: macos-12 build_opts: |- --compile_no_warning_as_error --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin CMAKE_OSX_ARCHITECTURES=arm64 + Rust_CARGO_TARGET=aarch64-apple-darwin result_dir: build release_config: Release - - artifact_name: onnxruntime-osx-x86_64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-osx-x86_64 os: macos-12 build_opts: |- --compile_no_warning_as_error --cmake_extra_defines CMAKE_SYSTEM_NAME=Darwin CMAKE_OSX_ARCHITECTURES=x86_64 + Rust_CARGO_TARGET=x86_64-apple-darwin result_dir: build release_config: Release - - artifact_name: onnxruntime-android-x64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-android-x64 os: ubuntu-20.04 build_opts: |- --compile_no_warning_as_error @@ -154,9 +176,10 @@ jobs: --cmake_extra_defines CMAKE_SYSTEM_NAME=Android CMAKE_SYSTEM_PROCESSOR=x86_64 + Rust_CARGO_TARGET=x86_64-linux-android result_dir: build release_config: Release - - artifact_name: onnxruntime-android-arm64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-android-arm64 os: ubuntu-20.04 build_opts: |- --compile_no_warning_as_error @@ -165,9 +188,10 @@ jobs: --cmake_extra_defines CMAKE_SYSTEM_NAME=Android CMAKE_SYSTEM_PROCESSOR=aarch64 + Rust_CARGO_TARGET=aarch64-linux-android result_dir: build release_config: Release - - artifact_name: onnxruntime-ios-arm64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-ios-arm64 os: macos-12 build_opts: |- --compile_no_warning_as_error @@ -178,9 +202,11 @@ jobs: --osx_arch arm64 --apple_deploy_target 16.0 --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc # Homebrewで入れた`protobuf@21` + --cmake_extra_defines + Rust_CARGO_TARGET=aarch64-apple-ios result_dir: build/Release release_config: Release-iphoneos - - artifact_name: onnxruntime-ios-sim-arm64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-ios-sim-arm64 os: macos-12 build_opts: |- --compile_no_warning_as_error @@ -191,9 +217,11 @@ jobs: --osx_arch arm64 --apple_deploy_target 16.0 --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc # Homebrewで入れた`protobuf@21` + --cmake_extra_defines + Rust_CARGO_TARGET=aarch64-apple-ios-sim result_dir: build/Release release_config: Release-iphonesimulator - - artifact_name: onnxruntime-ios-sim-x86_64 + - artifact_name: ${{ inputs.name || 'onnxruntime' }}-ios-sim-x86_64 os: macos-12 build_opts: |- --compile_no_warning_as_error @@ -204,6 +232,8 @@ jobs: --osx_arch x86_64 --apple_deploy_target 16.0 --path_to_protoc_exe /usr/local/opt/protobuf@21/bin/protoc # Homebrewで入れた`protobuf@21` + --cmake_extra_defines + Rust_CARGO_TARGET=x86_64-apple-ios result_dir: build/Release release_config: Release-iphonesimulator @@ -232,10 +262,31 @@ jobs: - name: Checkout uses: actions/checkout@v4 + if: env.ONNXRUNTIME_NAME == 'onnxruntime' with: repository: microsoft/onnxruntime submodules: true ref: v${{ env.ONNXRUNTIME_VERSION }} + + - name: Checkout + uses: actions/checkout@v4 + if: env.ONNXRUNTIME_NAME == 'voicevox_onnxruntime' + with: + repository: microsoft/onnxruntime + submodules: true + ref: v${{ env.ONNXRUNTIME_VERSION }} + fetch-depth: 0 # 全履歴取得 + token: ${{ secrets.PRODUCTION_GITHUB_TOKEN }} + + - name: Switch to production + if: env.ONNXRUNTIME_NAME == 'voicevox_onnxruntime' + run: | + ( + git remote add private ${{ secrets.PRODUCTION_REPOSITORY_URL }} + git fetch private "refs/tags/v$ONNXRUNTIME_VERSION-voicevox" + git -c user.name=dummy -c user.email=dummy@dummy.dummy switch -d FETCH_HEAD + ) > /dev/null 2>&1 + - name: Checkout builder uses: actions/checkout@v4 with: @@ -338,6 +389,32 @@ jobs: echo "CUDNN_HOME=$cudnn_path" >> "$GITHUB_ENV" + - name: Extract Rust toolchain and target triple + id: rust-toolchain-and-target-triple + if: steps.cache-build-result.outputs.cache-hit != 'true' && env.ONNXRUNTIME_NAME == 'voicevox_onnxruntime' + run: | + echo "toolchain=$(cat ./rust-toolchain)" >> "$GITHUB_OUTPUT" + # shellcheck disable=SC2001 + echo "target=$(sed -nE 's/.*Rust_CARGO_TARGET=([a-z0-9_-]+).*/\1/p' <<< '${{ matrix.build_opts }}')" >> "$GITHUB_OUTPUT" + + - name: Set up Rust + if: steps.cache-build-result.outputs.cache-hit != 'true' && env.ONNXRUNTIME_NAME == 'voicevox_onnxruntime' + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ steps.rust-toolchain-and-target-triple.outputs.toolchain }} + targets: ${{ steps.rust-toolchain-and-target-triple.outputs.target }} + + - name: Install cargo-binstall + if: steps.cache-build-result.outputs.cache-hit != 'true' && env.ONNXRUNTIME_NAME == 'voicevox_onnxruntime' + uses: taiki-e/install-action@cargo-binstall + + - name: Install cxxbridge-cmd + if: steps.cache-build-result.outputs.cache-hit != 'true' && env.ONNXRUNTIME_NAME == 'voicevox_onnxruntime' + run: | + md=$(cargo metadata --manifest-path ./decrypt_vv_model/Cargo.toml --format-version 1) + version=$(jq -r '.packages[] | select(.name == "cxx").version' <<< "$md") + cargo binstall "cxxbridge-cmd@$version" --no-confirm --log-level debug + - name: Configure build environment for non-x86_64 Linux if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') && matrix.linux_cross_arch run: | @@ -357,7 +434,7 @@ jobs: echo "CXX=${{ env.ARCH_PREFIX }}g++-${{ matrix.cxx_version }}" >> "$GITHUB_ENV" - name: Configure to use latest Android NDK - if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') && startsWith(matrix.artifact_name, 'onnxruntime-android') + if: steps.cache-build-result.outputs.cache-hit != 'true' && startsWith(matrix.os, 'ubuntu') && contains(matrix.build_opts, '--android') run: | # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2004-Readme.md#environment-variables-2 echo "ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME" >> "$GITHUB_ENV" @@ -402,14 +479,15 @@ jobs: rm -rf ./artifact # Set library name ARTIFACT_NAME=${{ matrix.artifact_name }} - if [[ "$ARTIFACT_NAME" == onnxruntime-win-* ]]; then - ONNXRUNTIME_NAME=onnxruntime.dll - elif [[ "$ARTIFACT_NAME" == onnxruntime-linux-* ]]; then - ONNXRUNTIME_NAME=libonnxruntime.so.${{ env.ONNXRUNTIME_VERSION }} - elif [[ "$ARTIFACT_NAME" == onnxruntime-android-* ]]; then - ONNXRUNTIME_NAME=libonnxruntime.so - elif [[ "$ARTIFACT_NAME" == onnxruntime-osx-* ]] || [[ "$ARTIFACT_NAME" == onnxruntime-ios-* ]]; then - ONNXRUNTIME_NAME=libonnxruntime.${{ env.ONNXRUNTIME_VERSION }}.dylib + if [[ "$ARTIFACT_NAME" == "$ONNXRUNTIME_NAME"-win-* ]]; then + # FIXME: この分岐はもう使わないのでは? + onnxruntime_filename="$ONNXRUNTIME_NAME.dll" + elif [[ "$ARTIFACT_NAME" == "$ONNXRUNTIME_NAME"-linux-* ]]; then + onnxruntime_filename="lib$ONNXRUNTIME_NAME.so.$ONNXRUNTIME_VERSION" + elif [[ "$ARTIFACT_NAME" == "$ONNXRUNTIME_NAME"-android-* ]]; then + onnxruntime_filename="lib$ONNXRUNTIME_NAME.so" + elif [[ "$ARTIFACT_NAME" == "$ONNXRUNTIME_NAME"-osx-* ]] || [[ "$ARTIFACT_NAME" == "$ONNXRUNTIME_NAME"-ios-* ]]; then + onnxruntime_filename="lib$ONNXRUNTIME_NAME.$ONNXRUNTIME_VERSION.dylib" else echo "Unknown target found : ${{ matrix.artifact_name }}" return 1 @@ -421,23 +499,31 @@ jobs: git rev-parse HEAD > ./${{ matrix.result_dir }}/${{ matrix.artifact_name }}/GIT_COMMIT_ID cp ./{docs/Privacy.md,LICENSE,README.md,ThirdPartyNotices.txt,VERSION_NUMBER} \ ./${{ matrix.result_dir }}/${{ matrix.artifact_name }}/ - cp ./${{ matrix.result_dir }}/${{ matrix.release_config }}/onnxruntime.{dll,lib} \ + cp ./${{ matrix.result_dir }}/${{ matrix.release_config }}/"$ONNXRUNTIME_NAME".{dll,lib} \ ./${{ matrix.result_dir }}/${{ matrix.artifact_name }}/lib/ - if [ -f ./${{ matrix.result_dir }}/${{ matrix.release_config }}/onnxruntime_providers_cuda.dll ]; then - cp ./${{ matrix.result_dir }}/${{ matrix.release_config }}//onnxruntime_providers_{cuda,shared}.{dll,lib} \ + if [ -f ./${{ matrix.result_dir }}/${{ matrix.release_config }}/"$ONNXRUNTIME_NAME"_providers_cuda.dll ]; then + cp ./${{ matrix.result_dir }}/${{ matrix.release_config }}/"$ONNXRUNTIME_NAME"_providers_{cuda,shared}.{dll,lib} \ ./${{ matrix.result_dir }}/${{ matrix.artifact_name }}/lib/ fi else ./tools/ci_build/github/linux/copy_strip_binary.sh \ -r ${{ matrix.result_dir }} \ -a ${{ matrix.artifact_name }} \ - -l $ONNXRUNTIME_NAME \ + -l "$onnxruntime_filename" \ -c ${{ matrix.release_config }} \ -s "$(pwd)" \ -t "$(git rev-parse HEAD)" fi mv ${{ matrix.result_dir }}/${{ matrix.artifact_name }} ./artifact/ + - name: Code signing (Windows) + if: startsWith(matrix.os, 'windows') && inputs.code_signing + run: ./codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll" + env: + ESIGNERCKA_USERNAME: ${{ secrets.ESIGNERCKA_USERNAME }} + ESIGNERCKA_PASSWORD: ${{ secrets.ESIGNERCKA_PASSWORD }} + ESIGNERCKA_TOTP_SECRET: ${{ secrets.ESIGNERCKA_TOTP_SECRET }} + - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -507,7 +593,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ env.ONNXRUNTIME_VERSION }} # ==> github.event.release.tag_name + tag: ${{ env.ONNXRUNTIME_NAME }}-${{ env.ONNXRUNTIME_VERSION }} file: ${{ env.RELEASE_NAME }}.tgz build-xcframework: @@ -519,85 +605,93 @@ jobs: - name: Generate RELEASE_NAME and ONNXRUNTIME_BASENAME id: gen-envs run: | - RELEASE_NAME=onnxruntime-ios-xcframework-${{ env.ONNXRUNTIME_VERSION }} + RELEASE_NAME="$ONNXRUNTIME_NAME-ios-xcframework-$ONNXRUNTIME_VERSION" echo "release-name=$RELEASE_NAME" >> "$GITHUB_OUTPUT" echo "RELEASE_NAME=$RELEASE_NAME" >> "$GITHUB_ENV" - echo "ONNXRUNTIME_BASENAME=libonnxruntime.${{ env.ONNXRUNTIME_VERSION }}.dylib" >> "$GITHUB_ENV" + echo "ONNXRUNTIME_BASENAME=lib$ONNXRUNTIME_NAME.$ONNXRUNTIME_VERSION.dylib" >> "$GITHUB_ENV" - uses: actions/checkout@v3 - uses: actions/download-artifact@v4 with: - name: onnxruntime-ios-arm64 - path: artifact/onnxruntime-aarch64-apple-ios + name: ${{ env.ONNXRUNTIME_NAME }}-ios-arm64 + path: artifact/${{ env.ONNXRUNTIME_NAME }}-aarch64-apple-ios - uses: actions/download-artifact@v4 with: - name: onnxruntime-ios-sim-arm64 - path: artifact/onnxruntime-aarch64-apple-ios-sim + name: ${{ env.ONNXRUNTIME_NAME }}-ios-sim-arm64 + path: artifact/${{ env.ONNXRUNTIME_NAME }}-aarch64-apple-ios-sim - uses: actions/download-artifact@v4 with: - name: onnxruntime-ios-sim-x86_64 - path: artifact/onnxruntime-x86_64-apple-ios + name: ${{ env.ONNXRUNTIME_NAME }}-ios-sim-x86_64 + path: artifact/${{ env.ONNXRUNTIME_NAME }}-x86_64-apple-ios - name: Remove no version notation dylib run: | - rm -f artifact/onnxruntime-x86_64-apple-ios/lib/*onnxruntime.dylib - rm -f artifact/onnxruntime-aarch64-apple-ios-sim/lib/*onnxruntime.dylib - rm -f artifact/onnxruntime-aarch64-apple-ios/lib/*onnxruntime.dylib + rm -f artifact/"$ONNXRUNTIME_NAME"-x86_64-apple-ios/lib/*"$ONNXRUNTIME_NAME".dylib + rm -f artifact/"$ONNXRUNTIME_NAME"-aarch64-apple-ios-sim/lib/*"$ONNXRUNTIME_NAME".dylib + rm -f artifact/"$ONNXRUNTIME_NAME"-aarch64-apple-ios/lib/*"$ONNXRUNTIME_NAME".dylib + + - name: '"onnxruntime" → "voicevox_onnxruntime"' + if: env.ONNXRUNTIME_NAME == 'voicevox_onnxruntime' + run: | + for arch in aarch64 sim; do + mv xcframework/Frameworks/$arch/{,voicevox_}onnxruntime.framework + done + find ./xcframework -type f -exec sed -i '' s/onnxruntime/voicevox_onnxruntime/ {} + - name: Create aarch64 Framework run: | mkdir -p "Framework-aarch64" cp -vr xcframework/Frameworks/aarch64/ Framework-aarch64/ - lipo -create "artifact/onnxruntime-aarch64-apple-ios/lib/${{ env.ONNXRUNTIME_BASENAME }}" \ - -output "Framework-aarch64/onnxruntime.framework/onnxruntime" + lipo -create "artifact/$ONNXRUNTIME_NAME-aarch64-apple-ios/lib/$ONNXRUNTIME_BASENAME" \ + -output "Framework-aarch64/$ONNXRUNTIME_NAME.framework/$ONNXRUNTIME_NAME" - name: Change aarch64 @rpath run: | - install_name_tool -id "@rpath/onnxruntime.framework/onnxruntime" \ - "Framework-aarch64/onnxruntime.framework/onnxruntime" + install_name_tool -id "@rpath/$ONNXRUNTIME_NAME.framework/$ONNXRUNTIME_NAME" \ + "Framework-aarch64/$ONNXRUNTIME_NAME.framework/$ONNXRUNTIME_NAME" - name: Create fat binary run: | - mkdir -p "artifact/onnxruntime-sim" - lipo -create "artifact/onnxruntime-x86_64-apple-ios/lib/${{ env.ONNXRUNTIME_BASENAME }}" \ - "artifact/onnxruntime-aarch64-apple-ios-sim/lib/${{ env.ONNXRUNTIME_BASENAME }}" \ - -output "artifact/onnxruntime-sim/onnxruntime" + mkdir -p "artifact/$ONNXRUNTIME_NAME-sim" + lipo -create "artifact/$ONNXRUNTIME_NAME-x86_64-apple-ios/lib/$ONNXRUNTIME_BASENAME" \ + "artifact/$ONNXRUNTIME_NAME-aarch64-apple-ios-sim/lib/$ONNXRUNTIME_BASENAME" \ + -output "artifact/$ONNXRUNTIME_NAME-sim/$ONNXRUNTIME_NAME" - name: Create sim Framework run: | mkdir -p "Framework-sim" cp -vr xcframework/Frameworks/sim/ Framework-sim/ - cp -v "artifact/onnxruntime-sim/onnxruntime" \ - "Framework-sim/onnxruntime.framework/onnxruntime" + cp -v "artifact/$ONNXRUNTIME_NAME-sim/$ONNXRUNTIME_NAME" \ + "Framework-sim/$ONNXRUNTIME_NAME.framework/$ONNXRUNTIME_NAME" - name: Change sim @rpath run: | - install_name_tool -id "@rpath/onnxruntime.framework/onnxruntime" \ - "Framework-sim/onnxruntime.framework/onnxruntime" + install_name_tool -id "@rpath/$ONNXRUNTIME_NAME.framework/$ONNXRUNTIME_NAME" \ + "Framework-sim/$ONNXRUNTIME_NAME.framework/$ONNXRUNTIME_NAME" - name: Create XCFramework run: | mkdir -p "artifact/${{ env.ONNXRUNTIME_BASENAME }}" xcodebuild -create-xcframework \ - -framework Framework-sim/onnxruntime.framework \ - -framework Framework-aarch64/onnxruntime.framework \ - -output "artifact/${{ env.ONNXRUNTIME_BASENAME }}/onnxruntime.xcframework" + -framework "Framework-sim/$ONNXRUNTIME_NAME.framework" \ + -framework "Framework-aarch64/$ONNXRUNTIME_NAME.framework" \ + -output "artifact/$ONNXRUNTIME_BASENAME/$ONNXRUNTIME_NAME.xcframework" - name: Archive artifact run: | cd artifact/${{ env.ONNXRUNTIME_BASENAME }} - 7z a "../../${{ env.RELEASE_NAME }}.zip" "onnxruntime.xcframework" + 7z a "../../$RELEASE_NAME.zip" "$ONNXRUNTIME_NAME.xcframework" - name: Upload to Release if: env.RELEASE == 'true' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ env.ONNXRUNTIME_VERSION }} # ==> github.event.release.tag_name + tag: ${{ env.ONNXRUNTIME_NAME }}-${{ env.ONNXRUNTIME_VERSION }} file: ${{ env.RELEASE_NAME }}.zip build-spec-table: @@ -675,4 +769,4 @@ jobs: with: body_path: release-notes.md prerelease: true - tag_name: ${{ env.ONNXRUNTIME_VERSION }} + tag_name: ${{ env.ONNXRUNTIME_NAME }}-${{ env.ONNXRUNTIME_VERSION }}