Skip to content

Commit

Permalink
add: add spec tables
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Jul 26, 2024
1 parent 2099c47 commit ec2acc2
Showing 1 changed file with 109 additions and 2 deletions.
111 changes: 109 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,40 @@ jobs:
path: artifact/*

- name: Generate RELEASE_NAME
if: env.RELEASE == 'true'
run: |
echo "RELEASE_NAME=${{ matrix.artifact_name }}-${{ env.ONNXRUNTIME_VERSION }}" >> $GITHUB_ENV
- name: Generate specifications
run: |
build_opts=(${{ matrix.build_opts }})
devices=CPU
for arg in "${build_opts[@]}"; do
case "$arg" in
CMAKE_SYSTEM_NAME=Windows) os=Windows ;;
CMAKE_SYSTEM_NAME=Linux) os=Linux ;;
CMAKE_SYSTEM_NAME=Darwin) os=macOS ;;
--android) os=Android ;;
--ios) os=iOS ;;
CMAKE_SYSTEM_PROCESSOR=x86_64 | CMAKE_OSX_ARCHITECTURES=x86_64 | x86_64) arch=x86_64 ;;
--x86) arch=x86 ;;
CMAKE_OSX_ARCHITECTURES=arm64 | --arm64 | arm64 | arm64-v8a) arch=AArch64 ;;
--arm) arch=ARMv7 ;;
--use_cuda) devices+=/CUDA ;;
--use_dml) devices+=/DirectML ;;
esac
done
cat \
<<< "<tr><td>$os</td><td>$arch</td><td>$devices</td><td>$RELEASE_NAME.tgz</td></tr>" \
> "./$RELEASE_NAME.html"
- name: Upload specifications
uses: actions/upload-artifact@v4
with:
name: specs-${{ matrix.artifact_name }}
path: ${{ env.RELEASE_NAME }}.html

- name: Rearchive artifact
if: env.RELEASE == 'true'
run: |
Expand All @@ -361,10 +391,15 @@ jobs:
build-xcframework:
needs: build-onnxruntime
runs-on: macos-12
outputs:
release-name: ${{ steps.gen-envs.outputs.release-name }}
steps:
- name: Generate RELEASE_NAME and ONNXRUNTIME_BASENAME
id: gen-envs
run: |
echo "RELEASE_NAME=onnxruntime-ios-xcframework-${{ env.ONNXRUNTIME_VERSION }}" >> $GITHUB_ENV
RELEASE_NAME="onnxruntime-ios-xcframework-${{ env.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"
- uses: actions/checkout@v3
Expand Down Expand Up @@ -442,3 +477,75 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.ONNXRUNTIME_VERSION }} # ==> github.event.release.tag_name
file: ${{ env.RELEASE_NAME }}.zip

build-spec-table:
needs: [build-onnxruntime, build-xcframework]
runs-on: ubuntu-22.04
steps:
- name: Download specifications
uses: actions/download-artifact@v4
with:
path: specs
pattern: specs-*
merge-multiple: true

- name: Construct release notes
run: |
release_notes=$(
cat <<EOF
## 動的ライブラリ
<table id="voicevox-onnxruntime-specs-v1format-v$ONNXRUNTIME_VERSION">
<thead>
<tr>
<th>OS</th>
<th>アーキテクチャ</th>
<th>デバイス</th>
<th>名前</th>
</tr>
</thead>
<tbody>
EOF
)
release_notes+=$'\n'
for body in specs/*.html; do
release_notes+=$' '
release_notes+=$(< "$body")
release_notes+=$'\n'
done
release_notes+=$(
cat <<EOF
</tbody>
</table>
## XCFramework
<table>
<thead>
<tr>
<th>OS</th>
<th>アーキテクチャ</th>
<th>デバイス</th>
<th>名前</th>
</tr>
</thead>
<tbody>
<tr>
<td>iOS</td>
<td>AArch64/x86_64</td>
<td>CPU</td>
<td>${{ needs.build-xcframework.outputs.release-name }}.zip</td>
</tr>
</tbody>
</table>
EOF
)
tee release-notes.md >&2 <<< "$release_notes"
- name: Update release notes
if: env.RELEASE == 'true'
uses: softprops/action-gh-release@v2
with:
body_path: release-notes.md
prerelease: true
tag_name: ${{ env.ONNXRUNTIME_VERSION }}

0 comments on commit ec2acc2

Please sign in to comment.