From d0d036b524fa545a69d08bbfa61291e9bff00938 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 22:30:16 +0900 Subject: [PATCH 01/45] add .github/workflows/build.yml --- .github/workflows/build.yml | 130 ++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..96909c6f5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,130 @@ +name: Build C++ Shared Library + +on: + push: + branches: + # - main + workflow_dispatch: + +jobs: + build_cpp_shared_library: + strategy: + fail-fast: false + matrix: + os: [ windows-2019, macos-10.15, ubuntu-18.04 ] + device: [ gpu, cpu ] + + exclude: + - os: macos-10.15 + device: gpu + + include: + - os: windows-2019 + library_path: Release/core.dll + + - os: macos-10.15 + library_path: libcore.dylib + + - os: ubuntu-18.04 + library_path: libcore.so + + - os: windows-2019 + device: gpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-gpu-1.9.0.zip + cmake_additional_options: -DENABLE_CUDA=ON + dst_library_name: core.dll + + - os: windows-2019 + device: cpu-x64 + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-1.9.0.zip + dst_library_name: core_cpu.dll + + - os: windows-2019 + device: cpu-x86 + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x86-1.9.0.zip + dst_library_name: core_cpu_x86.dll + + - os: windows-2019 + device: cpu-arm64 + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm64-1.9.0.zip + dst_library_name: core_cpu_arm64.dll + + - os: windows-2019 + device: cpu-arm + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm-1.9.0.zip + dst_library_name: core_cpu_arm.dll + + - os: macos-10.15 + device: cpu-x64 + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-osx-x64-1.9.0.tgz + dst_library_name: libcore_cpu.dylib + + - os: ubuntu-18.04 + device: gpu + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-gpu-1.9.0.tgz + cmake_additional_options: -DENABLE_CUDA=ON + dst_library_name: libcore.so + + - os: ubuntu-18.04 + device: cpu-x64 + onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz + dst_library_name: libcore_cpu.so + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - run: mkdir download + + # ONNX Runtime + - uses: actions/cache@v2 + id: onnxruntime-cache + with: + key: ${{ matrix.os }}-${{ matrix.device }}-onnxruntime-cache + path: download/onnxruntime + + # download/onnxruntime/lib/onnxruntime.dll + - if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && endsWith(matrix.onnxruntime_url, '.zip') + shell: bash + run: | + curl "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip + mkdir -p download/onnxruntime + + # strip-components + TEMPDIR=$(mktemp -d) + unzip download/onnxruntime.zip -d "${TEMPDIR}" + mv "${TEMPDIR}"/*/* onnxruntime/ + rm -rf "${TEMPDIR}" + + rm download/onnxruntime.zip + + # download/onnxruntime/lib/libonnxruntime.so + # download/onnxruntime/lib/libonnxruntime.dylib + - if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && endsWith(matrix.onnxruntime_url, '.tgz') + shell: bash + run: | + curl "${{ 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 + + # Build + - if: startsWith(matrix.os, 'windows') + uses: ilammy/msvc-dev-cmd@v1 + + - if: startsWith(matrix.os, 'mac') || startsWith(matrix.os, 'ubuntu') + uses: jwlawson/actions-setup-cmake@v1.9 + + - name: Build + run: | + cd onnx + cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . + cmake --build . --config Release + + # Upload + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.os }}-${{ matrix.device }}-cpp-shared-library + path: ${{ matrix.library_path }} + retention-days: 7 From 0414ee82ab7f7b5212c49d355744ceef6c43b519 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 22:36:03 +0900 Subject: [PATCH 02/45] follow redirect on download --- .github/workflows/build.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96909c6f5..9349e8129 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,14 +81,15 @@ jobs: - uses: actions/cache@v2 id: onnxruntime-cache with: - key: ${{ matrix.os }}-${{ matrix.device }}-onnxruntime-cache + key: ${{ matrix.os }}-${{ matrix.device }}-onnxruntime-cache-v1 path: download/onnxruntime # download/onnxruntime/lib/onnxruntime.dll - - if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && endsWith(matrix.onnxruntime_url, '.zip') + - name: Download ONNX Runtime (zip) + if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && endsWith(matrix.onnxruntime_url, '.zip') shell: bash run: | - curl "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip + curl -L "${{ matrix.onnxruntime_url }}" > download/onnxruntime.zip mkdir -p download/onnxruntime # strip-components @@ -101,10 +102,11 @@ jobs: # download/onnxruntime/lib/libonnxruntime.so # download/onnxruntime/lib/libonnxruntime.dylib - - if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && endsWith(matrix.onnxruntime_url, '.tgz') + - name: Download ONNX Runtime (tgz) + if: steps.onnxruntime-cache.outputs.cache-hit != 'true' && endsWith(matrix.onnxruntime_url, '.tgz') shell: bash run: | - curl "${{ matrix.onnxruntime_url }}" > download/onnxruntime.tgz + 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 @@ -117,6 +119,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.9 - name: Build + shell: bash run: | cd onnx cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . From df21e8a46cce92610892f7c40064a548114b9481 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 22:38:41 +0900 Subject: [PATCH 03/45] onnxruntime cache with url hash --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9349e8129..1da745f68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,10 +78,15 @@ jobs: - run: mkdir download # ONNX Runtime + + - name: Export ONNX Runtime url to calc hash + shell: bash + run: echo "${{ matrix.onnxruntime_url }}" > download/onnxruntime_url.txt + - uses: actions/cache@v2 id: onnxruntime-cache with: - key: ${{ matrix.os }}-${{ matrix.device }}-onnxruntime-cache-v1 + key: ${{ matrix.os }}-${{ matrix.device }}-onnxruntime-cache-v1-${{ hashFiles('download/onnxruntime_url.txt') }} path: download/onnxruntime # download/onnxruntime/lib/onnxruntime.dll From 36e3fbec075efd6d2269121434b9eeb9cb59767c Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 22:47:20 +0900 Subject: [PATCH 04/45] fix matrix --- .github/workflows/build.yml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1da745f68..561fd7a8f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,63 +11,55 @@ jobs: strategy: fail-fast: false matrix: - os: [ windows-2019, macos-10.15, ubuntu-18.04 ] - device: [ gpu, cpu ] - - exclude: - - os: macos-10.15 - device: gpu - include: - - os: windows-2019 - library_path: Release/core.dll - - - os: macos-10.15 - library_path: libcore.dylib - - - os: ubuntu-18.04 - library_path: libcore.so - - os: windows-2019 device: gpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-gpu-1.9.0.zip cmake_additional_options: -DENABLE_CUDA=ON + library_path: Release/core.dll dst_library_name: core.dll - os: windows-2019 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-1.9.0.zip + library_path: Release/core.dll dst_library_name: core_cpu.dll - os: windows-2019 device: cpu-x86 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x86-1.9.0.zip + library_path: Release/core.dll dst_library_name: core_cpu_x86.dll - os: windows-2019 device: cpu-arm64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm64-1.9.0.zip + library_path: Release/core.dll dst_library_name: core_cpu_arm64.dll - os: windows-2019 device: cpu-arm onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm-1.9.0.zip + library_path: Release/core.dll dst_library_name: core_cpu_arm.dll - os: macos-10.15 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-osx-x64-1.9.0.tgz + library_path: libcore.dylib dst_library_name: libcore_cpu.dylib - os: ubuntu-18.04 device: gpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-gpu-1.9.0.tgz cmake_additional_options: -DENABLE_CUDA=ON + library_path: libcore.so dst_library_name: libcore.so - os: ubuntu-18.04 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz + library_path: libcore.so dst_library_name: libcore_cpu.so runs-on: ${{ matrix.os }} @@ -83,7 +75,8 @@ jobs: shell: bash run: echo "${{ matrix.onnxruntime_url }}" > download/onnxruntime_url.txt - - uses: actions/cache@v2 + - name: Cache ONNX Runtime + uses: actions/cache@v2 id: onnxruntime-cache with: key: ${{ matrix.os }}-${{ matrix.device }}-onnxruntime-cache-v1-${{ hashFiles('download/onnxruntime_url.txt') }} @@ -123,6 +116,10 @@ jobs: - if: startsWith(matrix.os, 'mac') || startsWith(matrix.os, 'ubuntu') uses: jwlawson/actions-setup-cmake@v1.9 + - run: | + cd onnx + ls ../download/onnxruntime + - name: Build shell: bash run: | From c08b67933170c987d4f48c72631717a98da90db8 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 22:48:23 +0900 Subject: [PATCH 05/45] fix move --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 561fd7a8f..acecf2686 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,7 +93,7 @@ jobs: # strip-components TEMPDIR=$(mktemp -d) unzip download/onnxruntime.zip -d "${TEMPDIR}" - mv "${TEMPDIR}"/*/* onnxruntime/ + mv "${TEMPDIR}"/*/* download/onnxruntime/ rm -rf "${TEMPDIR}" rm download/onnxruntime.zip From 90ed9159b075a75898754fef614913bee88ad55c Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 22:59:28 +0900 Subject: [PATCH 06/45] install gcc 8 --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acecf2686..3e5ae3944 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -113,6 +113,13 @@ jobs: - if: startsWith(matrix.os, 'windows') uses: ilammy/msvc-dev-cmd@v1 + # gcc 7 (ubuntu-18.04 default) does not have stdc++fs + - name: Install gcc 8 + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get install -y gcc-8 + - if: startsWith(matrix.os, 'mac') || startsWith(matrix.os, 'ubuntu') uses: jwlawson/actions-setup-cmake@v1.9 From 0fb31da76173b9cd75a0cee32da35459ffcdddfe Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:01:35 +0900 Subject: [PATCH 07/45] install g++ 8 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e5ae3944..a14fb4dd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,7 +118,7 @@ jobs: if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update - sudo apt-get install -y gcc-8 + sudo apt-get install -y gcc-8 g++-8 - if: startsWith(matrix.os, 'mac') || startsWith(matrix.os, 'ubuntu') uses: jwlawson/actions-setup-cmake@v1.9 From c28dcc860eb80ee26e0274a5529346b0b06c55a0 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:02:44 +0900 Subject: [PATCH 08/45] fix library_path onnx --- .github/workflows/build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a14fb4dd9..e72f43e99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,50 +16,50 @@ jobs: device: gpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-gpu-1.9.0.zip cmake_additional_options: -DENABLE_CUDA=ON - library_path: Release/core.dll + library_path: onnx/Release/core.dll dst_library_name: core.dll - os: windows-2019 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-1.9.0.zip - library_path: Release/core.dll + library_path: onnx/Release/core.dll dst_library_name: core_cpu.dll - os: windows-2019 device: cpu-x86 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x86-1.9.0.zip - library_path: Release/core.dll + library_path: onnx/Release/core.dll dst_library_name: core_cpu_x86.dll - os: windows-2019 device: cpu-arm64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm64-1.9.0.zip - library_path: Release/core.dll + library_path: onnx/Release/core.dll dst_library_name: core_cpu_arm64.dll - os: windows-2019 device: cpu-arm onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm-1.9.0.zip - library_path: Release/core.dll + library_path: onnx/Release/core.dll dst_library_name: core_cpu_arm.dll - os: macos-10.15 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-osx-x64-1.9.0.tgz - library_path: libcore.dylib + library_path: onnx/libcore.dylib dst_library_name: libcore_cpu.dylib - os: ubuntu-18.04 device: gpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-gpu-1.9.0.tgz cmake_additional_options: -DENABLE_CUDA=ON - library_path: libcore.so + library_path: onnx/libcore.so dst_library_name: libcore.so - os: ubuntu-18.04 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz - library_path: libcore.so + library_path: onnx/libcore.so dst_library_name: libcore_cpu.so runs-on: ${{ matrix.os }} From dddac6474450fe7397dff6ac2f8eddfa6973f8c0 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:05:50 +0900 Subject: [PATCH 09/45] fix compiler version --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e72f43e99..9f9aa385e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,6 +130,10 @@ jobs: - name: Build shell: bash run: | + # fix compiler version + export CC=$(which gcc) + export CXX=$(which g++) + cd onnx cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . cmake --build . --config Release From 6718adb60ddb4b2025d3ab8161686919229d45eb Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:08:49 +0900 Subject: [PATCH 10/45] stop to use setup-cmake on ubuntu --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f9aa385e..0a93d5d1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,9 +118,9 @@ jobs: if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update - sudo apt-get install -y gcc-8 g++-8 + sudo apt-get install -y gcc-8 g++-8 cmake - - if: startsWith(matrix.os, 'mac') || startsWith(matrix.os, 'ubuntu') + - if: startsWith(matrix.os, 'mac') uses: jwlawson/actions-setup-cmake@v1.9 - run: | From a7f2f8da9a835dbfe1a04486ccfbf420eeac898f Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:09:16 +0900 Subject: [PATCH 11/45] remove fix gcc version --- .github/workflows/build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a93d5d1c..d5829343a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,10 +130,6 @@ jobs: - name: Build shell: bash run: | - # fix compiler version - export CC=$(which gcc) - export CXX=$(which g++) - cd onnx cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . cmake --build . --config Release From 82b2055799b394b12b7f0a2806f13c188cc1ad86 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:11:27 +0900 Subject: [PATCH 12/45] gcc 9 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5829343a..7bfad2d44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,11 +114,11 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 # gcc 7 (ubuntu-18.04 default) does not have stdc++fs - - name: Install gcc 8 + - name: Install gcc 9 if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update - sudo apt-get install -y gcc-8 g++-8 cmake + sudo apt-get install -y gcc-9 g++-9 cmake - if: startsWith(matrix.os, 'mac') uses: jwlawson/actions-setup-cmake@v1.9 From 0e24747d089f02cdee9f2debc93e4f437c61be5a Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:13:11 +0900 Subject: [PATCH 13/45] use build-essential --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7bfad2d44..3edbd2baa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,11 +114,11 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 # gcc 7 (ubuntu-18.04 default) does not have stdc++fs - - name: Install gcc 9 + - name: Install build-essential if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update - sudo apt-get install -y gcc-9 g++-9 cmake + sudo apt-get install -y build-essential cmake - if: startsWith(matrix.os, 'mac') uses: jwlawson/actions-setup-cmake@v1.9 From f96fbd692447abd64594963f01ec09a783adf4dd Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:13:48 +0900 Subject: [PATCH 14/45] add shell --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3edbd2baa..d1d3a357f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,6 +116,7 @@ jobs: # gcc 7 (ubuntu-18.04 default) does not have stdc++fs - name: Install build-essential if: startsWith(matrix.os, 'ubuntu') + shell: bash run: | sudo apt-get update sudo apt-get install -y build-essential cmake @@ -123,10 +124,6 @@ jobs: - if: startsWith(matrix.os, 'mac') uses: jwlawson/actions-setup-cmake@v1.9 - - run: | - cd onnx - ls ../download/onnxruntime - - name: Build shell: bash run: | From c0a23bdb14a65d6622321682899c45eb0d74a6dd Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:15:47 +0900 Subject: [PATCH 15/45] CC/CXX env --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1d3a357f..d56e950ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -126,6 +126,9 @@ jobs: - name: Build shell: bash + env: + CC: gcc-9 + CXX: g++-9 run: | cd onnx cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . From 143bd3bd8c0de0a9212661b9d39324b28e268a7b Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:17:04 +0900 Subject: [PATCH 16/45] gcc 8 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d56e950ee..6e46bf7a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,7 +119,7 @@ jobs: shell: bash run: | sudo apt-get update - sudo apt-get install -y build-essential cmake + sudo apt-get install -y gcc-8 g++-8 cmake - if: startsWith(matrix.os, 'mac') uses: jwlawson/actions-setup-cmake@v1.9 @@ -127,8 +127,8 @@ jobs: - name: Build shell: bash env: - CC: gcc-9 - CXX: g++-9 + CC: gcc-8 + CXX: g++-8 run: | cd onnx cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . From eda6461c0083a9002fddc2ea10d8ecdab8d06705 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:20:06 +0900 Subject: [PATCH 17/45] artifact_name --- .github/workflows/build.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e46bf7a7..a0589c223 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - build_cpp_shared_library: + build_cpp_shared: strategy: fail-fast: false matrix: @@ -16,36 +16,42 @@ jobs: device: gpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-gpu-1.9.0.zip cmake_additional_options: -DENABLE_CUDA=ON + artifact_name: windows-x64-gpu library_path: onnx/Release/core.dll dst_library_name: core.dll - os: windows-2019 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-1.9.0.zip + artifact_name: windows-x64-cpu library_path: onnx/Release/core.dll dst_library_name: core_cpu.dll - os: windows-2019 device: cpu-x86 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x86-1.9.0.zip + artifact_name: windows-x86-cpu library_path: onnx/Release/core.dll dst_library_name: core_cpu_x86.dll - os: windows-2019 device: cpu-arm64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm64-1.9.0.zip + artifact_name: windows-arm64-cpu library_path: onnx/Release/core.dll dst_library_name: core_cpu_arm64.dll - os: windows-2019 device: cpu-arm onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm-1.9.0.zip + artifact_name: windows-arm-cpu library_path: onnx/Release/core.dll dst_library_name: core_cpu_arm.dll - os: macos-10.15 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-osx-x64-1.9.0.tgz + artifact_name: osx-x64-cpu library_path: onnx/libcore.dylib dst_library_name: libcore_cpu.dylib @@ -53,12 +59,14 @@ jobs: device: gpu onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-gpu-1.9.0.tgz cmake_additional_options: -DENABLE_CUDA=ON + artifact_name: linux-x64-gpu library_path: onnx/libcore.so dst_library_name: libcore.so - os: ubuntu-18.04 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz + artifact_name: linux-x64-cpu library_path: onnx/libcore.so dst_library_name: libcore_cpu.so @@ -137,6 +145,6 @@ jobs: # Upload - uses: actions/upload-artifact@v2 with: - name: ${{ matrix.os }}-${{ matrix.device }}-cpp-shared-library + name: ${{ matrix.artifact_name }}-cpp-shared path: ${{ matrix.library_path }} retention-days: 7 From 2bfaa45cd6c993c909bff3568322f616f3eac2bd Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:23:29 +0900 Subject: [PATCH 18/45] CMAKE_GENERATOR_PLATFORM --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0589c223..1da79d4c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: - os: windows-2019 device: cpu-x86 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x86-1.9.0.zip + cmake_additional_options: -DCMAKE_GENERATOR_PLATFORM=Win32 artifact_name: windows-x86-cpu library_path: onnx/Release/core.dll dst_library_name: core_cpu_x86.dll @@ -37,6 +38,7 @@ jobs: - os: windows-2019 device: cpu-arm64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm64-1.9.0.zip + cmake_additional_options: -DCMAKE_GENERATOR_PLATFORM=arm64 artifact_name: windows-arm64-cpu library_path: onnx/Release/core.dll dst_library_name: core_cpu_arm64.dll @@ -44,6 +46,7 @@ jobs: - os: windows-2019 device: cpu-arm onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-arm-1.9.0.zip + cmake_additional_options: -DCMAKE_GENERATOR_PLATFORM=arm artifact_name: windows-arm-cpu library_path: onnx/Release/core.dll dst_library_name: core_cpu_arm.dll From 77b5f1dbd954e741644fcc9c64c2ce7892986235 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:25:34 +0900 Subject: [PATCH 19/45] build on release published --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1da79d4c9..91d25a127 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,9 @@ on: push: branches: # - main + release: + types: + - published workflow_dispatch: jobs: From 1861948e49dc6688f347af82c0ec7fad18ab6c77 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:28:13 +0900 Subject: [PATCH 20/45] use gcc-8 for linux --- .github/workflows/build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91d25a127..ec47dd6fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,7 +138,14 @@ jobs: - if: startsWith(matrix.os, 'mac') uses: jwlawson/actions-setup-cmake@v1.9 - - name: Build + - name: Configure (Windows, macOS) + shell: bash + run: | + cd onnx + cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . + + - name: Configure (Linux) + if: startsWith(matrix.os, 'ubuntu') shell: bash env: CC: gcc-8 @@ -146,6 +153,11 @@ jobs: run: | cd onnx cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . + + - name: Build + shell: bash + run: | + cd onnx cmake --build . --config Release # Upload From fe2ad7f521d07f6d3e09909dbe02f542988ac4c1 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:28:51 +0900 Subject: [PATCH 21/45] working-directory --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec47dd6fe..4063ad372 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,24 +140,24 @@ jobs: - name: Configure (Windows, macOS) shell: bash + working-directory: onnx run: | - cd onnx cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . - name: Configure (Linux) if: startsWith(matrix.os, 'ubuntu') shell: bash + working-directory: onnx env: CC: gcc-8 CXX: g++-8 run: | - cd onnx cmake -DONNXRUNTIME_DIR=../download/onnxruntime ${{ matrix.cmake_additional_options }} . - name: Build shell: bash + working-directory: onnx run: | - cd onnx cmake --build . --config Release # Upload From f36b7dbe30dc73eba3e41353c2fe8596435df102 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:30:04 +0900 Subject: [PATCH 22/45] gcc-8 only for linux --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4063ad372..a4c1bcd58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,6 +139,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.9 - name: Configure (Windows, macOS) + - if: !startsWith(matrix.os, 'ubuntu') shell: bash working-directory: onnx run: | From 45ecb9f1e9b1514190c69893d1dfc4f90c294bb3 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:32:07 +0900 Subject: [PATCH 23/45] rm empty line --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4c1bcd58..e126e01ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,7 +84,6 @@ jobs: - run: mkdir download # ONNX Runtime - - name: Export ONNX Runtime url to calc hash shell: bash run: echo "${{ matrix.onnxruntime_url }}" > download/onnxruntime_url.txt From 3d47c3ae315eb690ba050fa5728edd6d15a30e0d Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:33:36 +0900 Subject: [PATCH 24/45] fix syntax --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e126e01ea..ad0f8e08e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,7 +138,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.9 - name: Configure (Windows, macOS) - - if: !startsWith(matrix.os, 'ubuntu') + if: ! startsWith(matrix.os, 'ubuntu') shell: bash working-directory: onnx run: | From ac48800f2aea4dfc4c8127875bba662fd1210a41 Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:35:04 +0900 Subject: [PATCH 25/45] fix syntax --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad0f8e08e..85d02da6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,7 +138,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.9 - name: Configure (Windows, macOS) - if: ! startsWith(matrix.os, 'ubuntu') + if: ${{ !startsWith(matrix.os, 'ubuntu') }} shell: bash working-directory: onnx run: | From be69a1980c3719acb9aae26db4b251c51bfa83ed Mon Sep 17 00:00:00 2001 From: aoirint Date: Thu, 28 Oct 2021 23:35:47 +0900 Subject: [PATCH 26/45] comment --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85d02da6b..a7aeb207c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,7 +138,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.9 - name: Configure (Windows, macOS) - if: ${{ !startsWith(matrix.os, 'ubuntu') }} + if: ${{ !startsWith(matrix.os, 'ubuntu') }} # '!' cannot be used as a first character in YAML shell: bash working-directory: onnx run: | From 3624fab658bf7656955320cca6afc184236dc658 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 00:31:36 +0900 Subject: [PATCH 27/45] upload core.zip --- .github/workflows/build.yml | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7aeb207c..7a90612f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -166,3 +166,64 @@ jobs: name: ${{ matrix.artifact_name }}-cpp-shared path: ${{ matrix.library_path }} retention-days: 7 + + # Create core.zip + upload-to-release-cpp-shared: + if: github.event.release.tag_name != '' + needs: [build_cpp_shared] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + zip + + - name: Download and extract artifact + uses: actions/download-artifact@v2 + with: + path: artifacts/ + + - name: Rearchive artifacts + run: | + mkdir release + + readarray -t MAPPINGS < ${DST}" + continue + fi + + echo "Renaming ${DIR}/${SRC} => ${DST}" + mv "artifacts/${DIR}/${SRC}" "artifacts/${DIR}/${DST}" + done + + mv artifacts/*/* release/ + + cp core.h release/ + + zip -r core.zip release/ + + - name: Upload to Release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} # == github.event.release.tag_name + file: core.zip From 1eb3d559d4b3d4698c3439b4c445f2d72b317251 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 00:32:26 +0900 Subject: [PATCH 28/45] fix syntax --- .github/workflows/build.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a90612f4..850e92755 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -191,15 +191,15 @@ jobs: mkdir release readarray -t MAPPINGS < Date: Fri, 29 Oct 2021 00:35:08 +0900 Subject: [PATCH 29/45] rename job to use hyphen --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 850e92755..d1b105d7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: jobs: - build_cpp_shared: + build-cpp-shared: strategy: fail-fast: false matrix: @@ -170,7 +170,7 @@ jobs: # Create core.zip upload-to-release-cpp-shared: if: github.event.release.tag_name != '' - needs: [build_cpp_shared] + needs: [build-cpp-shared] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -225,5 +225,5 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ github.ref }} # == github.event.release.tag_name + tag: ${{ github.ref }} # ==> github.event.release.tag_name file: core.zip From ce361633e254f547f8fecdb59e16c28d19933ce2 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 00:36:56 +0900 Subject: [PATCH 30/45] fix dir name --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1b105d7a..8e63b4332 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -202,17 +202,17 @@ jobs: EOF for line in "${MAPPINGS[@]}"; do - DIR=$(echo $line | awk '$0=$1') + KND=$(echo $line | awk '$0=$1') SRC=$(echo $line | awk '$0=$2') DST=$(echo $line | awk '$0=$3') if [ "${SRC}" = "${DST}" ]; then - echo "Skip renaming ${DIR}/${SRC} => ${DST}" + echo "Skip renaming ${KND}/${SRC} => ${DST}" continue fi - echo "Renaming ${DIR}/${SRC} => ${DST}" - mv "artifacts/${DIR}/${SRC}" "artifacts/${DIR}/${DST}" + echo "Renaming ${KND}/${SRC} => ${DST}" + mv "artifacts/${KND}-cpp-shared/${SRC}" "artifacts/${KND}-cpp-shared/${DST}" done mv artifacts/*/* release/ From ce7240c89f74d0823dcabbf893b705102e90612c Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 00:41:58 +0900 Subject: [PATCH 31/45] strip release dir in core.zip --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e63b4332..0037545aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -219,7 +219,7 @@ jobs: cp core.h release/ - zip -r core.zip release/ + zip -r core.zip release/* - name: Upload to Release uses: svenstaro/upload-release-action@v2 From 3d2942bc998aeddcd4e0165d97f71b4bb9f5d713 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 00:45:43 +0900 Subject: [PATCH 32/45] rm dst_liibrary_path from build-cpp-shared --- .github/workflows/build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0037545aa..c233d8bcc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,14 +21,12 @@ jobs: cmake_additional_options: -DENABLE_CUDA=ON artifact_name: windows-x64-gpu library_path: onnx/Release/core.dll - dst_library_name: core.dll - os: windows-2019 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-win-x64-1.9.0.zip artifact_name: windows-x64-cpu library_path: onnx/Release/core.dll - dst_library_name: core_cpu.dll - os: windows-2019 device: cpu-x86 @@ -36,7 +34,6 @@ jobs: cmake_additional_options: -DCMAKE_GENERATOR_PLATFORM=Win32 artifact_name: windows-x86-cpu library_path: onnx/Release/core.dll - dst_library_name: core_cpu_x86.dll - os: windows-2019 device: cpu-arm64 @@ -44,7 +41,6 @@ jobs: cmake_additional_options: -DCMAKE_GENERATOR_PLATFORM=arm64 artifact_name: windows-arm64-cpu library_path: onnx/Release/core.dll - dst_library_name: core_cpu_arm64.dll - os: windows-2019 device: cpu-arm @@ -52,14 +48,12 @@ jobs: cmake_additional_options: -DCMAKE_GENERATOR_PLATFORM=arm artifact_name: windows-arm-cpu library_path: onnx/Release/core.dll - dst_library_name: core_cpu_arm.dll - os: macos-10.15 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-osx-x64-1.9.0.tgz artifact_name: osx-x64-cpu library_path: onnx/libcore.dylib - dst_library_name: libcore_cpu.dylib - os: ubuntu-18.04 device: gpu @@ -67,14 +61,12 @@ jobs: cmake_additional_options: -DENABLE_CUDA=ON artifact_name: linux-x64-gpu library_path: onnx/libcore.so - dst_library_name: libcore.so - os: ubuntu-18.04 device: cpu-x64 onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.9.0/onnxruntime-linux-x64-1.9.0.tgz artifact_name: linux-x64-cpu library_path: onnx/libcore.so - dst_library_name: libcore_cpu.so runs-on: ${{ matrix.os }} From a84cc582c9e59d36b057bbf3599dc48cefe39f13 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 00:46:15 +0900 Subject: [PATCH 33/45] strip release dir in core.zip --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c233d8bcc..13250c202 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -211,7 +211,8 @@ jobs: cp core.h release/ - zip -r core.zip release/* + cd release/ + zip -r core.zip * - name: Upload to Release uses: svenstaro/upload-release-action@v2 From 232ae6cba1fa8e887e9f56c0929f0327515c4df6 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 00:51:06 +0900 Subject: [PATCH 34/45] revert core.zip dir --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13250c202..615489cb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -212,7 +212,7 @@ jobs: cp core.h release/ cd release/ - zip -r core.zip * + zip -r ../core.zip * - name: Upload to Release uses: svenstaro/upload-release-action@v2 From 26787949061f10bae94257b059b18f72ee3d8e89 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 01:01:48 +0900 Subject: [PATCH 35/45] dump VERSION in core.zip --- .github/workflows/build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 615489cb7..e0d328d18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,6 +167,10 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set BUILD_IDENTIFIER env var + run: | + echo "BUILD_IDENTIFIER=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Install dependencies run: | sudo apt-get update @@ -211,6 +215,8 @@ jobs: cp core.h release/ + echo ${{ env.BUILD_IDENTIFIER }} > VERSION + cd release/ zip -r ../core.zip * From bff381be2663882ad1879502d39752ba7ac4ce76 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 01:08:02 +0900 Subject: [PATCH 36/45] add step name --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0d328d18..428031a9b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -153,7 +153,8 @@ jobs: cmake --build . --config Release # Upload - - uses: actions/upload-artifact@v2 + - name: Upload artifact + uses: actions/upload-artifact@v2 with: name: ${{ matrix.artifact_name }}-cpp-shared path: ${{ matrix.library_path }} From 6c301dd17a5950d51539c03c56fb6a529ef3142f Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 01:09:05 +0900 Subject: [PATCH 37/45] swap order --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 428031a9b..efa1c3a60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,6 +118,9 @@ jobs: - if: startsWith(matrix.os, 'windows') uses: ilammy/msvc-dev-cmd@v1 + - if: startsWith(matrix.os, 'mac') + uses: jwlawson/actions-setup-cmake@v1.9 + # gcc 7 (ubuntu-18.04 default) does not have stdc++fs - name: Install build-essential if: startsWith(matrix.os, 'ubuntu') @@ -126,9 +129,6 @@ jobs: sudo apt-get update sudo apt-get install -y gcc-8 g++-8 cmake - - if: startsWith(matrix.os, 'mac') - uses: jwlawson/actions-setup-cmake@v1.9 - - name: Configure (Windows, macOS) if: ${{ !startsWith(matrix.os, 'ubuntu') }} # '!' cannot be used as a first character in YAML shell: bash From 9fedda6e8a305e259113ae70b56a8cea5ed1a7b4 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 01:11:25 +0900 Subject: [PATCH 38/45] fix version dump dir --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efa1c3a60..68720770a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -216,7 +216,7 @@ jobs: cp core.h release/ - echo ${{ env.BUILD_IDENTIFIER }} > VERSION + echo ${{ env.BUILD_IDENTIFIER }} > release/VERSION cd release/ zip -r ../core.zip * From 66fc7697c9dd71884ce71ea6f5ff56a1d9db70fb Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 02:44:29 +0900 Subject: [PATCH 39/45] skip upload feature --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68720770a..ca855abae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,11 @@ on: - published workflow_dispatch: +env: + # Raw character weights are not public. + # Skip uploading to GitHub Release on public repo. + SKIP_UPLOADING_RELEASE_ASSET: ${{ secrets.SKIP_UPLOADING_RELEASE_ASSET || '1' }} + jobs: build-cpp-shared: strategy: @@ -162,7 +167,7 @@ jobs: # Create core.zip upload-to-release-cpp-shared: - if: github.event.release.tag_name != '' + if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && github.event.release.tag_name != '' needs: [build-cpp-shared] runs-on: ubuntu-latest steps: From 65aa8f4810b9134b355e56636af836b4f644898b Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 02:46:28 +0900 Subject: [PATCH 40/45] fix syntax --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca855abae..293a986a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,7 +167,7 @@ jobs: # Create core.zip upload-to-release-cpp-shared: - if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && github.event.release.tag_name != '' + if: ${{ env.SKIP_UPLOADING_RELEASE_ASSET != '1' && github.event.release.tag_name != '' }} needs: [build-cpp-shared] runs-on: ubuntu-latest steps: From 450422bec0862cfc1157b9afb1bfa8655947239f Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 02:55:43 +0900 Subject: [PATCH 41/45] global env cannot be used in job if --- .github/workflows/build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 293a986a7..6dec62dea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,11 +9,6 @@ on: - published workflow_dispatch: -env: - # Raw character weights are not public. - # Skip uploading to GitHub Release on public repo. - SKIP_UPLOADING_RELEASE_ASSET: ${{ secrets.SKIP_UPLOADING_RELEASE_ASSET || '1' }} - jobs: build-cpp-shared: strategy: @@ -167,7 +162,11 @@ jobs: # Create core.zip upload-to-release-cpp-shared: - if: ${{ env.SKIP_UPLOADING_RELEASE_ASSET != '1' && github.event.release.tag_name != '' }} + env: + # Raw character weights are not public. + # Skip uploading to GitHub Release on public repo. + SKIP_UPLOADING_RELEASE_ASSET: ${{ secrets.SKIP_UPLOADING_RELEASE_ASSET || '1' }} + if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && github.event.release.tag_name != '' needs: [build-cpp-shared] runs-on: ubuntu-latest steps: From 7e6790c8e7de47b327d34206a9d3e8ed5d4e050f Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 02:57:05 +0900 Subject: [PATCH 42/45] fix job env cannot used in job if --- .github/workflows/build.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dec62dea..0950bdb56 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,11 +162,9 @@ jobs: # Create core.zip upload-to-release-cpp-shared: - env: - # Raw character weights are not public. - # Skip uploading to GitHub Release on public repo. - SKIP_UPLOADING_RELEASE_ASSET: ${{ secrets.SKIP_UPLOADING_RELEASE_ASSET || '1' }} - if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && github.event.release.tag_name != '' + # Raw character weights are not public. + # Skip uploading to GitHub Release on public repo. + if: (${{ secrets.SKIP_UPLOADING_RELEASE_ASSET || '1' }} != '1') && github.event.release.tag_name != '' needs: [build-cpp-shared] runs-on: ubuntu-latest steps: From 07f91ea0d733ea8db5a68119958921433873557e Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 02:59:56 +0900 Subject: [PATCH 43/45] upload core.zip as artifact --- .github/workflows/build.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0950bdb56..1e1451519 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,11 @@ on: - published workflow_dispatch: +env: + # Raw character weights are not public. + # Skip uploading to GitHub Release on public repo. + SKIP_UPLOADING_RELEASE_ASSET: ${{ secrets.SKIP_UPLOADING_RELEASE_ASSET || '1' }} + jobs: build-cpp-shared: strategy: @@ -162,9 +167,7 @@ jobs: # Create core.zip upload-to-release-cpp-shared: - # Raw character weights are not public. - # Skip uploading to GitHub Release on public repo. - if: (${{ secrets.SKIP_UPLOADING_RELEASE_ASSET || '1' }} != '1') && github.event.release.tag_name != '' + if: github.event.release.tag_name != '' needs: [build-cpp-shared] runs-on: ubuntu-latest steps: @@ -223,7 +226,13 @@ jobs: cd release/ zip -r ../core.zip * + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + path: core.zip + - name: Upload to Release + if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} From 8233eccd822c350db57dd1c09f95fbb7d8705c97 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 03:07:34 +0900 Subject: [PATCH 44/45] check eq 0 to determine to upload or not --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e1451519..36505d9cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -232,7 +232,7 @@ jobs: path: core.zip - name: Upload to Release - if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' + if: env.SKIP_UPLOADING_RELEASE_ASSET == '0' uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} From 556fab8764d6c4b5a59ebe4423f80f0a2f4c60f5 Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 29 Oct 2021 04:18:13 +0900 Subject: [PATCH 45/45] rename shared libraries --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 36505d9cf..c27751c79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -193,14 +193,14 @@ jobs: mkdir release readarray -t MAPPINGS <