-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff5edd3
commit 9de89a6
Showing
13 changed files
with
553 additions
and
34 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,6 @@ name: Builder | |
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
ubuntu1804: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
name: linux | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
linux: | ||
runs-on: ubuntu-22.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch_type: | ||
[ | ||
aarch64-linux-musl, | ||
mips64el-linux-musl, | ||
mipsel-linux-musl, | ||
mipsel-linux-musln32, | ||
mipsel-linux-musln32sf, | ||
mipsel-linux-muslsf, | ||
riscv32-linux-musl, | ||
riscv64-linux-musl, | ||
sh2-linux-musl, | ||
x86_64-linux-musl, | ||
x86_64-linux-muslx32, | ||
] | ||
|
||
name: ${{ matrix.arch_type }} | ||
|
||
env: | ||
TOOLCHAIN_VERSION: 20231224 | ||
ONNX_VERSION: 1.15.1 | ||
ONNX_PKG_NAME: onnxruntime-1.15.1-${{ matrix.arch_type }}-static | ||
CV_VERSION: 4.8.1 | ||
CV_PKG_NAME: opencv-4.8.1-${{ matrix.arch_type }} | ||
BIN_PKG_NAME: linux-bin-${{ matrix.arch_type }} | ||
JNI_PKG_NAME: linux-jni-${{ matrix.arch_type }} | ||
CLIB_PKG_NAME: linux-clib-${{ matrix.arch_type }} | ||
|
||
steps: | ||
# 检出代码 | ||
- uses: actions/checkout@v3 | ||
|
||
# 部署musl | ||
- name: deploy musl | ||
run: | | ||
wget https://github.com/benjaminwan/musl-cross-builder/releases/download/${{ env.TOOLCHAIN_VERSION }}/${{ matrix.arch_type }}.7z -O ${{ matrix.arch_type }}.7z | ||
7z x ${{ matrix.arch_type }}.7z -aoa | ||
mv ${{ matrix.arch_type }}/ /opt/${{ matrix.arch_type }}/ | ||
# 下载onnxruntime-static | ||
- name: download onnxruntime-static | ||
run: | | ||
cd onnxruntime-static | ||
wget https://github.com/RapidAI/OnnxruntimeBuilder/releases/download/${{ env.ONNX_VERSION }}/${{ env.ONNX_PKG_NAME }}.7z -O ${{ env.ONNX_PKG_NAME }}.7z | ||
7z x ${{ env.ONNX_PKG_NAME }}.7z -aoa | ||
# 下载opencv-static | ||
- name: download opencv-static | ||
run: | | ||
cd opencv-static | ||
wget https://github.com/RapidAI/OpenCVBuilder/releases/download/${{ env.CV_VERSION }}/${{ env.CV_PKG_NAME }}.7z -O ${{ env.CV_PKG_NAME }}.7z | ||
7z x ${{ env.CV_PKG_NAME }}.7z -aoa | ||
# 编译 | ||
- name: build | ||
run: | | ||
wget https://github.com/benjaminwan/musl-cross-builder/raw/main/musl-cross.toolchain.cmake -O musl-cross.toolchain.cmake | ||
chmod a+x build-default.sh | ||
./build-default.sh "${{ matrix.arch_type }}" "/opt/${{ matrix.arch_type }}" | ||
# install文件夹改名linux,并使用7z压缩 | ||
- name: 7zip | ||
run: | | ||
mkdir ${{ env.BIN_PKG_NAME }} | ||
cp run-benchmark.sh ${{ env.BIN_PKG_NAME }}/run-benchmark.sh | ||
cp run-test.sh ${{ env.BIN_PKG_NAME }}/run-test.sh | ||
cp -r images ${{ env.BIN_PKG_NAME }}/images | ||
mv Linux-BIN-CPU/install/bin ${{ env.BIN_PKG_NAME }}/Linux-BIN-CPU | ||
cp others/README-bin.txt ${{ env.BIN_PKG_NAME }}/README.txt | ||
7z a ${{ env.BIN_PKG_NAME }}.7z ${{ env.BIN_PKG_NAME }} | ||
mkdir ${{ env.JNI_PKG_NAME }} | ||
mv Linux-JNI-CPU/install ${{ env.JNI_PKG_NAME }}/Linux-JNI-CPU | ||
cp others/README-jni.txt ${{ env.JNI_PKG_NAME }}/README.txt | ||
7z a ${{ env.JNI_PKG_NAME }}.7z ${{ env.JNI_PKG_NAME }} | ||
mkdir ${{ env.CLIB_PKG_NAME }} | ||
mv Linux-CLIB-CPU/install ${{ env.CLIB_PKG_NAME }}/Linux-CLIB-CPU | ||
cp others/README-clib.txt ${{ env.CLIB_PKG_NAME }}/README.txt | ||
7z a ${{ env.CLIB_PKG_NAME }}.7z ${{ env.CLIB_PKG_NAME }} | ||
# 上传artifact | ||
- name: upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.BIN_PKG_NAME }} | ||
path: ${{ env.BIN_PKG_NAME }}.7z | ||
|
||
- name: upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.JNI_PKG_NAME }} | ||
path: ${{ env.JNI_PKG_NAME }}.7z | ||
|
||
- name: upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.CLIB_PKG_NAME }} | ||
path: ${{ env.CLIB_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: true | ||
name: RapidOcrOnnx ${{ github.ref }} | ||
bodyFile: release.md | ||
artifacts: linux-*.7z | ||
allowUpdates: true | ||
artifactContentType: application/x-7z-compressed | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: macos | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
macos: | ||
runs-on: macos-latest | ||
|
||
env: | ||
ONNX_VERSION: 1.15.1 | ||
ONNX_PKG_NAME: onnxruntime-1.15.1-macos-static | ||
CV_VERSION: 4.8.1 | ||
CV_PKG_NAME: opencv-4.8.1-macos | ||
BIN_PKG_NAME: macos-bin | ||
JNI_PKG_NAME: macos-jni | ||
CLIB_PKG_NAME: macos-clib | ||
|
||
|
||
steps: | ||
# 检出代码 | ||
- uses: actions/checkout@v3 | ||
|
||
# 下载onnxruntime-static | ||
- name: download onnxruntime-static | ||
run: | | ||
cd onnxruntime-static | ||
wget https://github.com/RapidAI/OnnxruntimeBuilder/releases/download/${{ env.ONNX_VERSION }}/${{ env.ONNX_PKG_NAME }}.7z -O ${{ env.ONNX_PKG_NAME }}.7z | ||
7z x ${{ env.ONNX_PKG_NAME }}.7z -aoa | ||
# 下载opencv-static | ||
- name: download opencv-static | ||
run: | | ||
cd opencv-static | ||
wget https://github.com/RapidAI/OpenCVBuilder/releases/download/${{ env.CV_VERSION }}/${{ env.CV_PKG_NAME }}.7z -O ${{ env.CV_PKG_NAME }}.7z | ||
7z x ${{ env.CV_PKG_NAME }}.7z -aoa | ||
# 编译 | ||
- name: build | ||
run: | | ||
chmod a+x build-default.sh &&./build-default.sh | ||
# 压缩 | ||
- name: 7z | ||
run: | | ||
mkdir ${{ env.BIN_PKG_NAME }} | ||
cp run-benchmark.sh ${{ env.BIN_PKG_NAME }}/run-benchmark.sh | ||
cp run-test.sh ${{ env.BIN_PKG_NAME }}/run-test.sh | ||
cp -r images ${{ env.BIN_PKG_NAME }}/images | ||
mv Darwin-BIN-CPU/install/bin ${{ env.BIN_PKG_NAME }}/Darwin-BIN-CPU | ||
cp others/README-bin.txt ${{ env.BIN_PKG_NAME }}/README.txt | ||
7z a ${{ env.BIN_PKG_NAME }}.7z ${{ env.BIN_PKG_NAME }} | ||
mkdir ${{ env.JNI_PKG_NAME }} | ||
mv Darwin-JNI-CPU/install ${{ env.JNI_PKG_NAME }}/Darwin-JNI-CPU | ||
cp others/README-jni.txt ${{ env.JNI_PKG_NAME }}/README.txt | ||
7z a ${{ env.JNI_PKG_NAME }}.7z ${{ env.JNI_PKG_NAME }} | ||
mkdir ${{ env.CLIB_PKG_NAME }} | ||
mv Darwin-CLIB-CPU/install ${{ env.CLIB_PKG_NAME }}/Darwin-CLIB-CPU | ||
cp others/README-clib.txt ${{ env.CLIB_PKG_NAME }}/README.txt | ||
7z a ${{ env.CLIB_PKG_NAME }}.7z ${{ env.CLIB_PKG_NAME }} | ||
# 上传artifact | ||
- name: upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.BIN_PKG_NAME }} | ||
path: ${{ env.BIN_PKG_NAME }}.7z | ||
|
||
- name: upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.JNI_PKG_NAME }} | ||
path: ${{ env.JNI_PKG_NAME }}.7z | ||
|
||
- name: upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.CLIB_PKG_NAME }} | ||
path: ${{ env.CLIB_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: true | ||
name: RapidOcrOnnx ${{ github.ref }} | ||
bodyFile: release.md | ||
artifacts: macos-*.7z | ||
allowUpdates: true | ||
artifactContentType: application/x-7z-compressed | ||
token: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.