forked from onnx/onnx
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combine different release pipelines by the use of reusable workflows (o…
…nnx#6277) ### Description <!-- - Describe your changes. --> This pull request should be the start of a pipeline (current status of the considerations under onnx#6246) that automatically generates a whls after tagging, signs it and publishes it directly to Pypi to improve supply chain security. As this is all too much at once, the changes will be introduced and tested gradually. Changes related to this PR: Reusable Workflows are used to merge the individual OS release builds together (we need one process as we want to have all artifacts in one pipeline, so there is not need to download them manuelly). The workflows are currently not really "reusable", as we more or less use pypi creditionals in the workflow, among other things. I reused our testpypi weekly repo as I didn't want to change our behavoir for pypi and testpypi. Maybe it would make sense to adapt the process right away so that you can trigger our "Weekly" manually via the Github interface for testing and don't have to wait a week ;-) #### Key points for the review: * How do we want to configure concurrency * What concurrency-groups do we need? * Where do we need "cancel-in-progress"? #### Not part of the pull request: * Extract publish whl to pypi/testpyp * Introduce trusted publishing * ... ### Motivation and Context * see onnx#6246 --------- Signed-off-by: Andreas Fehlner <[email protected]> Co-authored-by: Justin Chu <[email protected]>
- Loading branch information
1 parent
2c4b0cd
commit d45ad99
Showing
5 changed files
with
127 additions
and
67 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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Copyright (c) ONNX Project Contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Create Releases | ||
on: | ||
schedule: | ||
# Run weekly on Monday 00:00 | ||
- cron: '00 00 * * MON' | ||
push: | ||
branches: [main, rel-*] | ||
pull_request: | ||
branches: [main, rel-*] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name == 'workflow_dispatch' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
call-workflow-ubuntu_x86: | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-latest'] | ||
uses: ./.github/workflows/release_linux_x86_64.yml | ||
with: | ||
os: "linux_x86_64" | ||
|
||
call-workflow-ubuntu_aarch64: | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-latest'] | ||
uses: ./.github/workflows/release_linux_aarch64.yml | ||
with: | ||
os: "linux_aarch64" | ||
|
||
call-workflow-win: | ||
strategy: | ||
matrix: | ||
os: ['windows-latest'] | ||
uses: ./.github/workflows/release_win.yml | ||
with: | ||
os: "win" | ||
|
||
call-workflow-mac: | ||
strategy: | ||
matrix: | ||
os: ['mac-latest'] | ||
uses: ./.github/workflows/release_mac.yml | ||
with: | ||
os: "macos" | ||
|
||
|
||
|
||
publish_to_testpypi: | ||
# TODO Add a deployment step for reviewing https://docs.github.com/en/actions/managing-workflow-runs/reviewing-deployments | ||
name: Release (Publish to testpypi, onnxweekly) | ||
runs-on: ubuntu-latest | ||
needs: [call-workflow-ubuntu_x86, call-workflow-ubuntu_aarch64, call-workflow-mac, call-workflow-win] | ||
if: (github.ref == 'refs/head/main') && (github.event_name != 'pull_request') && ((needs.call-workflow-mac.result == 'success') || (needs.call-workflow-ubuntu_x86.result == 'success') || (needs.call-workflow-ubuntu_aarch64.result == 'success') || (needs.call-workflow-win.result == 'success')) | ||
|
||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/onnx | ||
|
||
permissions: | ||
contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
id-token: write # IMPORTANT: mandatory for sigstore | ||
|
||
steps: | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: wheels* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Publish distribution to TestPyPI | ||
if: (github.event_name == 'schedule') && (github.repository_owner == 'onnx') | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
verbose: true | ||
print-hash: true | ||
|
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
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
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
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