musl-gcc #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: musl-gcc | |
on: | |
workflow_dispatch: | |
jobs: | |
musl-cross-build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
ver: | |
- { onnx: v1.18.0, musl: 14.1.0 } | |
arch: | |
[ | |
aarch64-linux-musl, #OK | |
aarch64_be-linux-musl, | |
arm-linux-musleabi, | |
arm-linux-musleabihf, | |
armeb-linux-musleabi, | |
armeb-linux-musleabihf, | |
armel-linux-musleabi, | |
armel-linux-musleabihf, | |
armv5l-linux-musleabi, | |
armv5l-linux-musleabihf, | |
armv5te-linux-musleabi, | |
armv6-linux-musleabi, | |
armv6-linux-musleabihf, | |
armv7-linux-musleabi, | |
armv7-linux-musleabihf, | |
armv7l-linux-musleabihf, | |
armv7m-linux-musleabi, | |
armv7r-linux-musleabihf, | |
i486-linux-musl, | |
i686-linux-musl, | |
i586-linux-musl, | |
m68k-linux-musl, | |
microblaze-linux-musl, | |
microblazeel-linux-musl, | |
mips-linux-musl, | |
mips-linux-muslsf, | |
mips-linux-musln32sf, | |
mips64-linux-musl, | |
mips64-linux-musln32, | |
mips64-linux-musln32sf, | |
mips64el-linux-musl, #OK | |
mips64el-linux-musln32, | |
mips64el-linux-musln32sf, | |
mipsel-linux-musl, #OK | |
mipsel-linux-musln32, #OK | |
mipsel-linux-musln32sf, #OK | |
mipsel-linux-muslsf, #OK | |
or1k-linux-musl, | |
powerpc-linux-musl, | |
powerpc-linux-muslsf, | |
powerpc64-linux-musl, | |
powerpc64le-linux-musl, | |
powerpcle-linux-musl, | |
powerpcle-linux-muslsf, | |
riscv32-linux-musl, #OK | |
riscv64-linux-musl, #OK | |
s390x-linux-musl, | |
sh2-linux-musl, #OK | |
sh2eb-linux-musl, | |
sh4-linux-musl, | |
sh4eb-linux-musl, | |
x86_64-linux-musl, #OK | |
x86_64-linux-muslx32, #OK | |
] | |
# exclude: | |
# - arch: aarch64_be-linux-musl #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: armeb-linux-musleabi #error: ‘MLAS_FLOAT32X4’ does not name a type | |
# - arch: armeb-linux-musleabihf #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: armel-linux-musleabi #error: ‘MLAS_FLOAT32X4’ does not name a type | |
# - arch: armel-linux-musleabihf #error: static assertion failed | |
# - arch: arm-linux-musleabi #error: ‘MLAS_FLOAT32X4’ does not name a type | |
# - arch: arm-linux-musleabihf #error: static assertion failed | |
# - arch: armv5l-linux-musleabi #error: ‘MLAS_FLOAT32X4’ does not name a type | |
# - arch: armv5l-linux-musleabihf #error: static assertion failed | |
# - arch: armv5te-linux-musleabi #error: ‘MLAS_FLOAT32X4’ does not name a type | |
# - arch: armv6-linux-musleabi #error: ‘MLAS_FLOAT32X4’ does not name a type | |
# - arch: armv6-linux-musleabihf #error: static assertion failed | |
# - arch: armv7-linux-musleabi #error: ‘MLAS_FLOAT32X4’ does not name a type | |
# - arch: armv7-linux-musleabihf #error: static assertion failed | |
# - arch: armv7l-linux-musleabihf #error: static assertion failed | |
# - arch: armv7m-linux-musleabi #error: ‘MLAS_FLOAT32X4’ was not declared in this scope | |
# - arch: armv7r-linux-musleabihf #error: static assertion failed | |
# - arch: i486-linux-musl #error: SSE vector return without SSE enabled changes the ABI | |
# - arch: i586-linux-musl #error: SSE vector return without SSE enabled changes the ABI | |
# - arch: i686-linux-musl #error: SSE vector return without SSE enabled changes the ABI | |
# - arch: m68k-linux-musl #error: static assertion failed | |
# - arch: microblazeel-linux-musl #error: static assertion failed: Platform is not 64-bit | |
# - arch: microblaze-linux-musl #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: mips64el-linux-musln32 #error: static assertion failed: Platform is not 64-bit | |
# - arch: mips64el-linux-musln32sf #error: static assertion failed: Platform is not 64-bit | |
# - arch: mips64-linux-musl #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: mips64-linux-musln32 #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: mips64-linux-musln32sf #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: powerpc64le-linux-musl #error: there are no arguments to ‘vec_splat’ that depend on a template parameter, so a declaration of ‘vec_splat’ must be available | |
# - arch: powerpc64-linux-musl #error: there are no arguments to ‘vec_splat’ that depend on a template parameter, so a declaration of ‘vec_splat’ must be available | |
# - arch: powerpcle-linux-musl #error: GCC vector returned by reference: non-standard ABI extension with no compatibility guarantee | |
# - arch: powerpcle-linux-muslsf #error: GCC vector returned by reference: non-standard ABI extension with no compatibility guarantee | |
# - arch: powerpc-linux-musl #error: GCC vector returned by reference: non-standard ABI extension with no compatibility guarantee | |
# - arch: powerpc-linux-muslsf #error: GCC vector returned by reference: non-standard ABI extension with no compatibility guarantee | |
# - arch: mips-linux-musl #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: mips-linux-muslsf #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: mips-linux-musln32sf #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: or1k-linux-musl #error: static assertion failed: Platform is not 64-bit | |
# - arch: s390x-linux-musl #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: sh2eb-linux-musl #error: static assertion failed: ORT format only supports little-endian machines | |
# - arch: sh4-linux-musl #error: unable to find a register to spill in class ‘R0_REGS’ | |
# - arch: sh4eb-linux-musl #error: static assertion failed: ORT format only supports little-endian machines | |
name: ${{ matrix.arch }} | |
env: | |
BUILD_SCRIPT: build-onnxruntime-musl.sh | |
BUILD_OPTIONS: onnxruntime_cmake_options.txt | |
SHARED_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-${{ matrix.arch }}-shared | |
STATIC_PKG_NAME: onnxruntime-${{ matrix.ver.onnx }}-${{ matrix.arch }}-static | |
steps: | |
# 检出代码 | |
- uses: actions/checkout@v4 | |
# 部署musl | |
- name: deploy musl | |
run: | | |
wget https://github.com/benjaminwan/musl-cross-builder/releases/download/${{ matrix.ver.musl }}/${{ matrix.arch }}-${{ matrix.ver.musl }}.7z -O ${{ matrix.arch }}.7z | |
7z x ${{ matrix.arch }}.7z -aoa | |
mv ${{ matrix.arch }}/ /opt/${{ matrix.arch }}/ | |
# 检出onnxruntime | |
- name: checkout onnxruntime | |
uses: actions/checkout@v4 | |
with: | |
repository: microsoft/onnxruntime | |
path: onnxruntime-${{ matrix.ver.onnx }} | |
ref: ${{ matrix.ver.onnx }} | |
submodules: recursive | |
- name: git submodule sync | |
run: | | |
cd onnxruntime-${{ matrix.ver.onnx }} | |
git submodule sync --recursive | |
git submodule update --init --recursive | |
# 复制 | |
- name: copy | |
run: | | |
cp ${{ env.BUILD_SCRIPT }} onnxruntime-${{ matrix.ver.onnx }} | |
cp ${{ env.BUILD_OPTIONS }} onnxruntime-${{ matrix.ver.onnx }} | |
cp -r patches onnxruntime-${{ matrix.ver.onnx }}/ | |
wget https://github.com/benjaminwan/musl-cross-builder/raw/main/musl-cross.toolchain.cmake -O musl-cross.toolchain.cmake | |
cp musl-cross.toolchain.cmake onnxruntime-${{ matrix.ver.onnx }} | |
- name: build | |
run: | | |
cd onnxruntime-${{ matrix.ver.onnx }} | |
chmod a+x ${{ env.BUILD_SCRIPT }} | |
./${{ env.BUILD_SCRIPT }} -n '${{ matrix.arch }}' -p '/opt/${{ matrix.arch }}' | |
# install文件夹改名linux,并使用7z压缩 | |
- name: 7zip shared lib | |
run: | | |
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-Release-${{ matrix.arch }}/install linux | |
7z a ${{ env.SHARED_PKG_NAME }}.7z linux | |
rm -r -f linux | |
- name: 7zip static lib | |
run: | | |
cp -r onnxruntime-${{ matrix.ver.onnx }}/build-Release-${{ matrix.arch }}/install-static linux | |
7z a ${{ env.STATIC_PKG_NAME }}.7z linux | |
rm -r -f linux | |
# 上传artifact | |
# - name: upload shared lib | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: ${{ env.SHARED_PKG_NAME }} | |
# path: ${{ env.SHARED_PKG_NAME }}.7z | |
# - name: upload static lib | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: ${{ env.STATIC_PKG_NAME }} | |
# path: ${{ env.STATIC_PKG_NAME }}.7z | |
# 获取所有的git log和tag | |
- name: Unshallow | |
run: git fetch --prune --unshallow | |
# 获取git log 从 previousTag 到 lastTag | |
- name: Get git log | |
id: git-log | |
run: | | |
previousTag=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) | |
lastTag=$(git describe --abbrev=0 --tags) | |
echo "previousTag:$previousTag ~ lastTag:$lastTag" | |
log=$(git log $previousTag..$lastTag --pretty=format:'- %cd %an: %s\n' --date=format:'%Y-%m-%d %H:%M:%S') | |
echo "$log" | |
echo "log_state="$log"" >> $GITHUB_ENV | |
# 创建Changelog文件 triggered by git tag push | |
- name: Generate Changelog | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
echo -e '${{ env.log_state }}' > release.md | |
# 创建release 上传release | |
# https://github.com/marketplace/actions/create-release | |
- name: Create release and upload-archive | |
uses: ncipollo/release-action@v1 | |
with: | |
prerelease: false | |
bodyFile: release.md | |
artifacts: 'onnxruntime-*.7z' | |
allowUpdates: true | |
artifactContentType: application/x-7z-compressed | |
token: ${{ secrets.GITHUB_TOKEN }} |