From 45d85ab7e9db0f372ff25c4e275d4bc1094a919a Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Fri, 2 Aug 2024 00:39:47 +0900 Subject: [PATCH] =?UTF-8?q?``=E3=81=AE=E7=B5=84=E3=81=BF=E7=AB=8B?= =?UTF-8?q?=E3=81=A6=E3=82=92`build-spec-table`=E3=81=AB=E9=9B=86=E7=B4=84?= =?UTF-8?q?=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 | 49 ++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1724b2..d225289 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -364,29 +364,29 @@ jobs: esac done - # ONNX Runtimeが示す順番に従う - if [ "$use_cuda" = 1 ]; then - devices=/CUDA - fi - if [ "$use_dml" = 1 ]; then - devices+=/DirectML - fi - devices+=/CPU - devices=${devices:1} - - specs="" - specs+="" - specs+="" - specs+="" - specs+="" - specs+='' - cat <<< "$specs" > "$RELEASE_NAME.html" + jq ' + { + "os": $os, + "arch": $arch, + # ONNX Runtimeが示す順番に従う + "devices": [ + ("CUDA" | select($use_cuda == "1")), + ("DirectML" | select($use_dml == "1")), + "CPU" + ] | join("/") + }' \ + -n \ + --arg os "$os" \ + --arg arch "$arch" \ + --arg use_cuda "$use_cuda" \ + --arg use_dml "$use_dml" \ + > "$RELEASE_NAME.json" - name: Upload specifications uses: actions/upload-artifact@v4 with: name: specs-${{ matrix.artifact_name }} - path: ${{ env.RELEASE_NAME }}.html + path: ${{ env.RELEASE_NAME }}.json - name: Rearchive artifact if: env.RELEASE == 'true' @@ -523,10 +523,15 @@ jobs: EOF ) release_notes+=$'\n' - for body in specs/*.html; do - release_notes+=$' ' - release_notes+=$(< "$body") - release_notes+=$'\n' + for specs_file in specs/*.json; do + specs=$(< "$specs_file") + release_name=${specs_file%.json} + release_notes+=$' \n' + release_notes+=" "$'\n' + release_notes+=" "$'\n' + release_notes+=" "$'\n' + release_notes+=" "$'\n' + release_notes+=$' \n' done release_notes+=$( cat <
$os$arch$devices$RELEASE_NAME.tgz
$(jq .os -r <<< "$specs")$(jq .arch -r <<< "$specs")$(jq .devices -r <<< "$specs")$release_name.tgz