From d57e97e955cf0a5c8678adf0cdab13cedd56408c Mon Sep 17 00:00:00 2001 From: Kaito Udagawa Date: Sat, 23 Sep 2023 02:25:10 +0900 Subject: [PATCH] Bump 1.16.0 (#7) * 1.16.0 * Fix * Update build.yml * Fix * Update .gitignore * Update Build-Windows.ps1 * Update Build-Windows.ps1 * Update build.yml --- .github/workflows/build.yml | 62 +++++++++++++++------------------- .gitignore | 2 +- Build-Windows.ps1 | 66 +++++++++++++++++++++++++++++++++++++ Build.ps1 | 62 ---------------------------------- onnxruntime | 2 +- 5 files changed, 94 insertions(+), 100 deletions(-) create mode 100644 Build-Windows.ps1 delete mode 100644 Build.ps1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 429917b..49a4f64 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,64 +5,54 @@ on: branches: - "main" tags: - - '*' + - "*" pull_request: branches: - "main" jobs: - Build: - runs-on: "windows-latest" + BuildWindows: + runs-on: "windows-2022" + + strategy: + matrix: + config: + - "Release" steps: - uses: "actions/checkout@v3" with: submodules: "recursive" - - name: "Run Build.ps1" - run: "./Build.ps1" + - name: "Run Build-Windows.ps1" + run: "./Build-Windows.ps1 -Configuration ${{ matrix.config }}" - uses: "actions/upload-artifact@v3" with: - name: "onnxruntime-static-win" - path: "onnxruntime-static-win.zip" + name: "onnxruntime-win-${{ matrix.config }}" + path: "release/onnxruntime-windows-${{ matrix.config }}.zip" Release: - runs-on: ubuntu-22.04 + runs-on: "ubuntu-22.04" if: "github.event_name == 'push' && contains(github.ref, 'refs/tags/')" - needs: [Build] - defaults: - run: - shell: bash + needs: + - "BuildWindows" permissions: - contents: write + contents: "write" steps: - - name: Get Metadata - id: metadata + - name: "Get Metadata" + id: "metadata" run: | - ## METADATA SCRIPT echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT - - name: Download build artifacts - uses: actions/download-artifact@v3 - - - name: Generate Checksums - run: | - ## CHECKSUM GENERATION SCRIPT - shopt -s extglob - echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt - for file in ${{ github.workspace }}/**/@(*.pkg|*.exe|*.deb|*.zip); do - echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt - done + - name: "Download build artifacts" + uses: "actions/download-artifact@v3" - - name: Create Release - id: create_release - uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 + - name: "Create Release" + uses: "softprops/action-gh-release@v1" with: - draft: false - prerelease: ${{ contains(steps.metadata.outputs.version, 'rc') || contains(steps.metadata.outputs.version, 'beta') }} - tag_name: ${{ steps.metadata.outputs.version }} - name: "${{ env.PLUGIN_NAME }} ${{ steps.metadata.outputs.version }}" - body_path: ${{ github.workspace }}/CHECKSUMS.txt + draft: true + tag_name: "${{ steps.metadata.outputs.version }}" + name: "${{ steps.metadata.outputs.version }}" files: | - ${{ github.workspace }}/**/*.zip \ No newline at end of file + ${{ github.workspace }}/**/*.zip diff --git a/.gitignore b/.gitignore index b36ca5f..ea8d74d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ build -prefix +release *.zip diff --git a/Build-Windows.ps1 b/Build-Windows.ps1 new file mode 100644 index 0000000..0301f6b --- /dev/null +++ b/Build-Windows.ps1 @@ -0,0 +1,66 @@ +Param($Configuration) + +if (Test-Path release) { + Remove-Item release -Recurse -Force +} +New-Item release\$Configuration\bin -ItemType Directory -Force +New-Item release\$Configuration\include -ItemType Directory -Force +New-Item release\$Configuration\lib -ItemType Directory -Force + +python onnxruntime\tools\ci_build\build.py --cmake_generator "Visual Studio 17 2022" --build_dir build --config $Configuration --parallel --skip_tests --skip_submodule_sync --use_dml + +$binArray = + "build\packages\Microsoft.AI.DirectML.1.12.1\bin\x64-win\DirectML.dll", + "build\packages\Microsoft.AI.DirectML.1.12.1\bin\x64-win\DirectML.lib" + +$includeArray = + "onnxruntime\include\onnxruntime\core\framework\provider_options.h", + "onnxruntime\include\onnxruntime\core\providers\cpu\cpu_provider_factory.h", + "onnxruntime\include\onnxruntime\core\providers\dml\dml_provider_factory.h", + "onnxruntime\include\onnxruntime\core\session\onnxruntime_c_api.h", + "onnxruntime\include\onnxruntime\core\session\onnxruntime_cxx_api.h", + "onnxruntime\include\onnxruntime\core\session\onnxruntime_cxx_inline.h", + "onnxruntime\include\onnxruntime\core\session\onnxruntime_float16.h", + "onnxruntime\include\onnxruntime\core\session\onnxruntime_run_options_config_keys.h", + "onnxruntime\include\onnxruntime\core\session\onnxruntime_session_options_config_keys.h" + +$libArray = + "build\$Configuration\_deps\abseil_cpp-build\absl\base\$Configuration\absl_throw_delegate.lib", + "build\$Configuration\_deps\abseil_cpp-build\absl\container\$Configuration\absl_raw_hash_set.lib", + "build\$Configuration\_deps\abseil_cpp-build\absl\hash\$Configuration\absl_city.lib", + "build\$Configuration\_deps\abseil_cpp-build\absl\hash\$Configuration\absl_hash.lib", + "build\$Configuration\_deps\abseil_cpp-build\absl\hash\$Configuration\absl_low_level_hash.lib", + "build\$Configuration\_deps\onnx-build\$Configuration\onnx_proto.lib", + "build\$Configuration\_deps\onnx-build\$Configuration\onnx.lib", + "build\$Configuration\_deps\re2-build\$Configuration\re2.lib", + "build\$Configuration\$Configuration\onnxruntime_common.lib", + "build\$Configuration\$Configuration\onnxruntime_flatbuffers.lib", + "build\$Configuration\$Configuration\onnxruntime_framework.lib", + "build\$Configuration\$Configuration\onnxruntime_graph.lib", + "build\$Configuration\$Configuration\onnxruntime_mlas.lib", + "build\$Configuration\$Configuration\onnxruntime_optimizer.lib", + "build\$Configuration\$Configuration\onnxruntime_providers_dml.lib", + "build\$Configuration\$Configuration\onnxruntime_providers_shared.lib", + "build\$Configuration\$Configuration\onnxruntime_providers.lib", + "build\$Configuration\$Configuration\onnxruntime_session.lib", + "build\$Configuration\$Configuration\onnxruntime_util.lib" + +if ($Configuration -eq "Debug") { + $libArray += "build\Debug\_deps\protobuf-build\Debug\libprotobuf-lited.lib" +} else { + $libArray += "build\Release\_deps\protobuf-build\Release\libprotobuf-lite.lib" +} + +foreach ($bin in $binArray) { + Copy-Item $bin release\$Configuration\bin -Verbose +} + +foreach ($include in $includeArray) { + Copy-Item $include release\$Configuration\include -Verbose +} + +foreach ($lib in $libArray) { + Copy-Item $lib release\$Configuration\lib -Verbose +} + +Compress-Archive release\$Configuration\* release\onnxruntime-windows-$Configuration.zip -Verbose diff --git a/Build.ps1 b/Build.ps1 deleted file mode 100644 index 699916f..0000000 --- a/Build.ps1 +++ /dev/null @@ -1,62 +0,0 @@ -if (Test-Path prefix) { - Remove-Item prefix -Recurse -Force -} -New-Item prefix\bin -ItemType Directory -Force -New-Item prefix\include -ItemType Directory -Force -New-Item prefix\lib -ItemType Directory -Force - -if (Test-Path onnxruntime-static-win.zip) { - Remove-Item onnxruntime-static-win.zip -Force -} - -python onnxruntime\tools\ci_build\build.py --cmake_generator "Visual Studio 17 2022" --build_dir build --config Release --parallel --skip_tests --skip_submodule_sync --use_dml - -$binArray = - "build\packages\Microsoft.AI.DirectML.1.12.0\bin\x64-win\DirectML.dll", - "build\packages\Microsoft.AI.DirectML.1.12.0\bin\x64-win\DirectML.lib" - -$includeArray = - "onnxruntime\include\onnxruntime\core\framework\provider_options.h", - "onnxruntime\include\onnxruntime\core\providers\cpu\cpu_provider_factory.h", - "onnxruntime\include\onnxruntime\core\providers\dml\dml_provider_factory.h", - "onnxruntime\include\onnxruntime\core\session\onnxruntime_c_api.h", - "onnxruntime\include\onnxruntime\core\session\onnxruntime_cxx_api.h", - "onnxruntime\include\onnxruntime\core\session\onnxruntime_cxx_inline.h", - "onnxruntime\include\onnxruntime\core\session\onnxruntime_run_options_config_keys.h", - "onnxruntime\include\onnxruntime\core\session\onnxruntime_session_options_config_keys.h" - -$libArray = - "build\Release\_deps\abseil_cpp-build\absl\base\Release\absl_throw_delegate.lib", - "build\Release\_deps\abseil_cpp-build\absl\container\Release\absl_raw_hash_set.lib", - "build\Release\_deps\abseil_cpp-build\absl\hash\Release\absl_city.lib", - "build\Release\_deps\abseil_cpp-build\absl\hash\Release\absl_hash.lib", - "build\Release\_deps\abseil_cpp-build\absl\hash\Release\absl_low_level_hash.lib", - "build\Release\_deps\onnx-build\Release\onnx_proto.lib", - "build\Release\_deps\onnx-build\Release\onnx.lib", - "build\Release\_deps\protobuf-build\Release\libprotobuf-lite.lib", - "build\Release\_deps\re2-build\Release\re2.lib", - "build\Release\Release\onnxruntime_common.lib", - "build\Release\Release\onnxruntime_flatbuffers.lib", - "build\Release\Release\onnxruntime_framework.lib", - "build\Release\Release\onnxruntime_graph.lib", - "build\Release\Release\onnxruntime_mlas.lib", - "build\Release\Release\onnxruntime_optimizer.lib", - "build\Release\Release\onnxruntime_providers_dml.lib", - "build\Release\Release\onnxruntime_providers_shared.lib", - "build\Release\Release\onnxruntime_providers.lib", - "build\Release\Release\onnxruntime_session.lib", - "build\Release\Release\onnxruntime_util.lib" - -foreach ($bin in $binArray) { - Copy-Item $bin prefix\bin -Verbose -} - -foreach ($include in $includeArray) { - Copy-Item $include prefix\include -Verbose -} - -foreach ($lib in $libArray) { - Copy-Item $lib prefix\lib -Verbose -} - -Compress-Archive prefix\* onnxruntime-static-win.zip -Verbose diff --git a/onnxruntime b/onnxruntime index baeece4..e7a0495 160000 --- a/onnxruntime +++ b/onnxruntime @@ -1 +1 @@ -Subproject commit baeece44ba075009c6bfe95891a8c1b3d4571cb3 +Subproject commit e7a0495a874251e9747b2ce0683e0580282c54df