|
1 | | -name: Release & Upload Wheel |
| 1 | +name: CI && Release & Upload Wheel |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + onnxruntime_branch: |
| 7 | + type: string |
| 8 | + default: "main" |
4 | 9 | workflow_dispatch: |
| 10 | + inputs: |
| 11 | + onnxruntime_branch: |
| 12 | + type: string |
| 13 | + default: "main" |
5 | 14 | push: |
6 | 15 | branches: |
7 | 16 | - main |
8 | | - - shayan-create-wheel-release |
| 17 | + pull_request: |
| 18 | + branches: |
| 19 | + - main |
9 | 20 |
|
10 | 21 | jobs: |
11 | 22 | build_and_upload_wheel: |
12 | | - runs-on: linux-mk |
| 23 | + runs-on: The_CTOs_Choice |
13 | 24 | container: |
14 | 25 | image: ghcr.io/quadric-io/tvm:devel |
15 | 26 | options: "--mount type=bind,source=${{ github.workspace }},target=/workspace" |
16 | 27 | steps: |
17 | 28 | - name: Checkout repository |
18 | | - uses: actions/checkout@v3 |
| 29 | + uses: actions/checkout@v4 |
| 30 | + with: |
| 31 | + repository: quadric-io/onnxruntime |
| 32 | + ref: ${{ inputs.onnxruntime_branch || github.ref }} |
19 | 33 | - name: Build ONNX Runtime wheel |
20 | 34 | working-directory: /workspace |
21 | 35 | run: | |
22 | 36 | python3 -m pip install cmake --upgrade |
23 | | - ./build.sh --build_wheel --config Release --parallel --skip_tests --skip_submodule_sync |
| 37 | + ./build.sh --build_wheel --config Release --parallel ${{ github.event_name == 'pull_request' && ' ' || '--skip_tests'}} --skip_submodule_sync --allow_running_as_root |
24 | 38 | wheel_path=$(find . -name '*.whl' | xargs readlink -f) |
25 | 39 | echo "wheel_path=$wheel_path" >> $GITHUB_ENV |
26 | 40 | - name: Count releases |
27 | 41 | id: count_releases |
| 42 | + if: github.event_name != 'pull_request' |
28 | 43 | env: |
29 | 44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
30 | 45 | run: | |
|
33 | 48 | --url https://api.github.com/repos/${{ github.repository }}/releases \ |
34 | 49 | --header "Authorization: Bearer $GITHUB_TOKEN" | jq length) |
35 | 50 | echo "count=$count" >> $GITHUB_ENV |
| 51 | + - name: Upload Artifact |
| 52 | + uses: actions/upload-artifact@v3 |
| 53 | + with: |
| 54 | + name: ort-wheel |
| 55 | + path: ${{ env.wheel_path }} |
36 | 56 | - name: Create Release |
| 57 | + if: github.ref == 'main' && ( github.event_name != 'workflow_call' && github.event_name != 'workflow_dispatch' ) |
37 | 58 | uses: softprops/action-gh-release@v1 |
38 | 59 | env: |
39 | 60 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
0 commit comments