Skip to content

Commit 7692a89

Browse files
committed
ci: Enable workflow_call
- Enables other repos to call this workflow with parameterized options such as onnxruntime_branch - To be accompanied by a corresponding sdk-cli change.
1 parent c51a23f commit 7692a89

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.github/workflows/wheel.yaml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,45 @@
1-
name: Release & Upload Wheel
1+
name: CI && Release & Upload Wheel
22

33
on:
4+
workflow_call:
5+
inputs:
6+
onnxruntime_branch:
7+
type: string
8+
default: "main"
49
workflow_dispatch:
10+
inputs:
11+
onnxruntime_branch:
12+
type: string
13+
default: "main"
514
push:
615
branches:
716
- main
8-
- shayan-create-wheel-release
17+
pull_request:
18+
branches:
19+
- main
920

1021
jobs:
1122
build_and_upload_wheel:
12-
runs-on: linux-mk
23+
runs-on: The_CTOs_Choice
1324
container:
1425
image: ghcr.io/quadric-io/tvm:devel
1526
options: "--mount type=bind,source=${{ github.workspace }},target=/workspace"
1627
steps:
1728
- 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 }}
1933
- name: Build ONNX Runtime wheel
2034
working-directory: /workspace
2135
run: |
2236
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
2438
wheel_path=$(find . -name '*.whl' | xargs readlink -f)
2539
echo "wheel_path=$wheel_path" >> $GITHUB_ENV
2640
- name: Count releases
2741
id: count_releases
42+
if: github.event_name != 'pull_request'
2843
env:
2944
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3045
run: |
@@ -33,7 +48,13 @@ jobs:
3348
--url https://api.github.com/repos/${{ github.repository }}/releases \
3449
--header "Authorization: Bearer $GITHUB_TOKEN" | jq length)
3550
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 }}
3656
- name: Create Release
57+
if: github.ref == 'main' && ( github.event_name != 'workflow_call' && github.event_name != 'workflow_dispatch' )
3758
uses: softprops/action-gh-release@v1
3859
env:
3960
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)