Skip to content

Commit 8d37714

Browse files
committed
adding initial new yaml files
1 parent 9e31e74 commit 8d37714

File tree

2 files changed

+70
-80
lines changed

2 files changed

+70
-80
lines changed
Lines changed: 70 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,52 @@
1-
name: CI && Release & Upload Wheel
1+
name: CI
2+
3+
concurrency:
4+
group: onnxruntime-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
5+
cancel-in-progress: true
26

37
on:
48
workflow_call:
59
inputs:
10+
is_experimental:
11+
description: "Create an experimental build (use latest constants)"
12+
type: boolean
13+
default: false
614
onnxruntime_branch:
715
type: string
816
default: "main"
17+
compiler_version:
18+
default: "stable"
19+
type: string
20+
constants_version:
21+
default: "stable"
22+
type: string
923
workflow_dispatch:
1024
inputs:
25+
is_experimental:
26+
description: "Create an experimental build (use latest constants)"
27+
type: boolean
28+
default: false
1129
onnxruntime_branch:
1230
type: string
1331
default: "main"
14-
promote_to_stable:
15-
type: boolean
16-
default: false
17-
description: 'Promote this build to stable release'
32+
compiler_version:
33+
description: "compiler_version: stable, experimental or latest (unused by ONNX Runtime)"
34+
default: "stable"
35+
type: string
36+
constants_version:
37+
description: "constants_version: stable, latest or a branch name (unused by ONNX Runtime)"
38+
default: "stable"
39+
type: string
1840
push:
1941
branches:
2042
- main
2143
pull_request:
2244
branches:
2345
- main
2446

47+
env:
48+
GH_PAT: ${{ secrets.GH_PAT }}
49+
2550
jobs:
2651
build_and_upload_wheel_linux:
2752
runs-on: The_CTOs_Choice
@@ -34,13 +59,28 @@ jobs:
3459
with:
3560
repository: quadric-io/onnxruntime
3661
ref: ${{ inputs.onnxruntime_branch || github.ref }}
62+
token: ${{ secrets.GH_PAT }}
63+
64+
- name: Fetch sha
65+
id: fetch_sha
66+
run: |
67+
# Fetch current sha for the potential creation of an experimental release
68+
CURRENT_SHA=$(git rev-parse HEAD)
69+
echo "current_sha=$CURRENT_SHA" >> $GITHUB_OUTPUT
70+
3771
- name: Build ONNX Runtime wheel
3872
working-directory: /workspace
3973
run: |
4074
python3 -m pip install "cmake<4"
41-
./build.sh --build_wheel --config Release --parallel ${{ github.event_name == 'pull_request' && ' ' || '--skip_tests'}} --skip_submodule_sync --allow_running_as_root --compile_no_warning_as_error
75+
76+
# Always run tests - no skipping for any scenario
77+
test_args=""
78+
79+
./build.sh --build_wheel --config Release --parallel $test_args --skip_submodule_sync --allow_running_as_root --compile_no_warning_as_error
80+
4281
wheel_path=$(find . -name '*.whl' | xargs readlink -f)
4382
echo "wheel_path=$wheel_path" >> $GITHUB_ENV
83+
4484
- name: Upload Artifact
4585
uses: actions/upload-artifact@v4
4686
with:
@@ -56,25 +96,42 @@ jobs:
5696
with:
5797
repository: quadric-io/onnxruntime
5898
ref: ${{ inputs.onnxruntime_branch || github.ref }}
99+
token: ${{ secrets.GH_PAT }}
100+
101+
- name: Fetch sha
102+
id: fetch_sha
103+
run: |
104+
# Fetch current sha for the potential creation of an experimental release
105+
CURRENT_SHA=$(git rev-parse HEAD)
106+
echo "current_sha=$CURRENT_SHA" >> $GITHUB_OUTPUT
107+
59108
- name: Install python dependencies
60109
run: |
61110
python3 -m pip install -r requirements.txt
62111
python3 -m pip install -r requirements-quadric.txt
112+
63113
- name: Build ONNX Runtime wheel
64114
run: |
65-
./build.sh --build_wheel --config Release --parallel ${{ github.event_name == 'pull_request' && ' ' || '--skip_tests'}} --skip_submodule_sync --compile_no_warning_as_error --skip_submodule_sync --apple_deploy_target 12
115+
# Always run tests - no skipping for any scenario
116+
test_args=""
117+
118+
./build.sh --build_wheel --config Release --parallel $test_args --skip_submodule_sync --compile_no_warning_as_error --skip_submodule_sync --apple_deploy_target 12
119+
66120
wheel_path=$(find . -name '*.whl' | xargs readlink -f)
67121
echo "wheel_path=$wheel_path" >> $GITHUB_ENV
122+
68123
- name: Upload Artifact
69124
uses: actions/upload-artifact@v4
70125
with:
71126
name: ort-wheel-mac
72127
path: ${{ env.wheel_path }}
73128

129+
# Keep your existing release logic for main branch pushes
74130
create_release:
75131
permissions:
76132
contents: write
77-
if: (github.ref == 'refs/heads/main') && ( github.event_name != 'workflow_call' && github.event_name != 'workflow_dispatch' )
133+
# Only create releases on main branch pushes (not when called from tagger)
134+
if: (github.ref == 'refs/heads/main') && (github.event_name == 'push')
78135
needs: [build_and_upload_wheel_mac, build_and_upload_wheel_linux]
79136
runs-on: ubuntu-latest
80137
steps:
@@ -83,15 +140,17 @@ jobs:
83140
with:
84141
name: ort-wheel-linux
85142
path: artifacts/
143+
86144
- name: Download ort-wheel-mac artifact
87145
uses: actions/download-artifact@v4
88146
with:
89147
name: ort-wheel-mac
90148
path: artifacts/
149+
91150
- name: Get next release tag
92151
id: get_tag
93152
env:
94-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
153+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
95154
run: |
96155
latest_tag=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
97156
https://api.github.com/repos/${{ github.repository }}/releases \
@@ -112,82 +171,13 @@ jobs:
112171
113172
echo "next_tag=$next_tag" >> $GITHUB_ENV
114173
echo "next_tag=$next_tag" >> $GITHUB_OUTPUT
174+
115175
- name: Create Release and Upload Both Assets
116176
uses: softprops/action-gh-release@v1
117177
env:
118-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
119179
with:
120180
tag_name: ${{ steps.get_tag.outputs.next_tag }}
121181
name: Release ${{ steps.get_tag.outputs.next_tag }}
122182
files: |
123183
artifacts/*.whl
124-
125-
promote_to_stable:
126-
permissions:
127-
contents: write
128-
if: inputs.promote_to_stable == true
129-
needs: [build_and_upload_wheel_mac, build_and_upload_wheel_linux]
130-
runs-on: ubuntu-latest
131-
steps:
132-
- name: Checkout repository
133-
uses: actions/checkout@v4
134-
with:
135-
repository: quadric-io/onnxruntime
136-
fetch-depth: 0
137-
ref: ${{ inputs.onnxruntime_branch || 'main' }}
138-
139-
- name: Download all wheel artifacts
140-
uses: actions/download-artifact@v4
141-
with:
142-
path: artifacts/
143-
144-
- name: Get current commit info
145-
id: commit_info
146-
run: |
147-
# Get the actual commit we checked out, not github.sha
148-
commit_sha=$(git rev-parse HEAD)
149-
echo "commit_sha=$commit_sha" >> $GITHUB_OUTPUT
150-
short_sha=$(git rev-parse --short HEAD)
151-
echo "short_sha=$short_sha" >> $GITHUB_OUTPUT
152-
commit_message=$(git log -1 --pretty=format:"%s" HEAD)
153-
echo "commit_message=$commit_message" >> $GITHUB_OUTPUT
154-
155-
- name: Delete existing stable release
156-
env:
157-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
158-
run: |
159-
# Delete tag locally and remotely
160-
git tag -d stable 2>/dev/null || true
161-
git push origin :refs/tags/stable 2>/dev/null || true
162-
163-
# Delete existing release
164-
release_id=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
165-
"https://api.github.com/repos/${{ github.repository }}/releases/tags/stable" \
166-
| jq -r '.id // empty')
167-
168-
if [ ! -z "$release_id" ] && [ "$release_id" != "null" ]; then
169-
curl -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" \
170-
"https://api.github.com/repos/${{ github.repository }}/releases/$release_id"
171-
fi
172-
173-
- name: Create stable tag and release
174-
run: |
175-
commit_sha=${{ steps.commit_info.outputs.commit_sha }}
176-
git tag stable $commit_sha
177-
git push origin stable
178-
179-
- name: Create Stable Release
180-
uses: softprops/action-gh-release@v1
181-
env:
182-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
183-
with:
184-
tag_name: stable
185-
name: "Stable Release"
186-
body: |
187-
This is the latest stable release of onnxruntime.
188-
189-
**Promoted from:** ${{ steps.commit_info.outputs.short_sha }}
190-
**Commit:** ${{ steps.commit_info.outputs.commit_message }}
191-
**Build:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
192-
files: |
193-
artifacts/**/*.whl

.github/workflows/promote.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)