Skip to content

edit windows builder #15

edit windows builder

edit windows builder #15

Workflow file for this run

name: macos
on:
workflow_dispatch:
push:
tags:
- '*'
jobs:
macos:
runs-on: macos-latest
env:
ONNX_VERSION: v1.15.1
SHARED_PKG_NAME: onnxruntime-1.15.1-macos-shared
STATIC_PKG_NAME: onnxruntime-1.15.1-macos-static
steps:
# Setup JDK 11
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
# 检出代码
- uses: actions/checkout@v3
# 检出onnxruntime
- name: checkout onnxruntime
uses: actions/checkout@v3
with:
repository: microsoft/onnxruntime
path: onnxruntime-${{ env.ONNX_VERSION }}
ref: ${{ env.ONNX_VERSION }}
submodules: recursive
# 安装openmp
- name: install openmp
run: |
brew install libomp
# 复制编译脚本
- name: copy build script
run: |
cp build-onnxruntime.sh onnxruntime-${{ env.ONNX_VERSION }}
cp onnxruntime_cmake_options.txt onnxruntime-${{ env.ONNX_VERSION }}
# 编译
- name: build
run: |
cd onnxruntime-${{ env.ONNX_VERSION }}
chmod a+x build-onnxruntime.sh
./build-onnxruntime.sh
# install文件夹改名macos,并使用7z压缩
- name: 7z
run: |
mv onnxruntime-${{ env.ONNX_VERSION }}/build-Release/install macos
7z a ${{ env.SHARED_PKG_NAME }}.7z macos
rm -r -f macos
mv onnxruntime-${{ env.ONNX_VERSION }}/build-Release/install-static macos
7z a ${{ env.STATIC_PKG_NAME }}.7z macos
rm -r -f macos
# 上传artifact
- name: upload
uses: actions/upload-artifact@v2
with:
name: ${{ env.SHARED_PKG_NAME }}
path: ${{ env.SHARED_PKG_NAME }}.7z
- name: upload
uses: actions/upload-artifact@v2
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
name: onnxruntime ${{ github.ref }}
bodyFile: release.md
artifacts: ${{ env.SHARED_PKG_NAME }}.7z, ${{ env.STATIC_PKG_NAME }}.7z
allowUpdates: true
artifactContentType: application/x-7z-compressed
token: ${{ secrets.GITHUB_TOKEN }}