Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Onnx Onnx Create Release Workflow

From Leeroopedia


Knowledge Sources
Domains CI/CD, Release Engineering, Packaging
Last Updated 2026-02-10 00:00 GMT

Overview

GitHub Actions workflow that orchestrates multi-platform ONNX release builds and publishes packages to PyPI repositories.

Description

The Create Releases workflow is the primary release automation pipeline for the ONNX project. It coordinates building platform-specific wheel packages for Linux, Windows, and macOS, as well as source distributions (sdist), and handles publishing to four distinct PyPI targets: pypi-weekly, testpypi-weekly, testpypi-release, and pypi-release.

The workflow is triggered by three event types. First, it runs on a weekly schedule (every Monday at 00:00 UTC) for automated preview builds. Second, it responds to push events on the main and rel-* branches, as well as pull_request events that carry the "run release CIs" label. Third, it supports workflow_dispatch for manual triggering, which exposes five input parameters: publish_pypi_weekly, publish_testpypi_weekly, publish_testpypi_release, publish_pypi_release, and build_mode (release or preview).

The build phase delegates to four reusable sub-workflows: release_linux.yml, release_win.yml, release_mac.yml, and release_sdist.yml. Each receives the operating system identifier and build mode. Once all platform builds succeed, multiple gated publishing jobs determine whether to upload to the appropriate PyPI endpoint. Safety checks enforce that release builds must use "release" build mode, that the package version matches the release branch name, and that only the official onnx repository owner can publish. Publishing uses the pypa/gh-action-pypi-publish action with OIDC-based trusted publishing (id-token: write permission). A final test_source_dist job validates the published source distribution.

Concurrency is managed at the workflow level to prevent overlapping runs on the same branch, with automatic cancellation of in-progress runs when a new one starts.

Usage

This workflow is used for all ONNX release operations. For automated weekly preview builds, it runs unattended on the Monday schedule. For release candidates and official releases, maintainers trigger it manually via workflow_dispatch from the appropriate rel-* branch with the desired publishing targets enabled. Contributors can test the build pipeline on pull requests by adding the "run release CIs" label.

Code Reference

Source Location

Signature

name: Create Releases
on:
  schedule:
    - cron: '0 0 * * MON'
  push:
    branches: [main, rel-*]
  pull_request:
    branches: [main, rel-*]
    types:
      - labeled
  workflow_dispatch:
    inputs:
      publish_pypi_weekly:
        description: 'Publish to pypi-weekly'
        type: choice
        options: ['yes', 'no']
      publish_testpypi_weekly:
        description: 'Publish to testpypi-weekly'
        type: choice
        options: ['yes', 'no']
      publish_testpypi_release:
        description: 'Publish to testpypi-release'
        type: choice
        options: ['yes', 'no']
      publish_pypi_release:
        description: 'Caution: Publish to pypi-release'
        type: choice
        options: ['yes', 'no']
      build_mode:
        description: 'Specify the build mode (release or preview)'
        type: choice
        options: ['release', 'preview']

Import

# Reusable workflow references
uses: ./.github/workflows/release_linux.yml
uses: ./.github/workflows/release_win.yml
uses: ./.github/workflows/release_mac.yml
uses: ./.github/workflows/release_sdist.yml
uses: ./.github/workflows/preview_source_dist_test.yml

# External actions
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e

I/O Contract

Inputs

Name Type Required Description
publish_pypi_weekly choice (yes/no) Yes (dispatch) Whether to publish preview build to pypi-weekly (main branch only)
publish_testpypi_weekly choice (yes/no) Yes (dispatch) Whether to publish preview build to testpypi-weekly (main branch only)
publish_testpypi_release choice (yes/no) Yes (dispatch) Whether to publish release build to testpypi (rel-* branches only)
publish_pypi_release choice (yes/no) Yes (dispatch) Whether to publish official release to pypi (rel-* branches only)
build_mode choice (release/preview) Yes (dispatch) Build mode; defaults to 'preview'

Outputs

Name Type Description
wheels (artifact) Binary wheels Platform-specific wheel files for Linux, Windows, macOS
sdist (artifact) Source distribution Source distribution tarball
PyPI packages Published packages Packages uploaded to the selected PyPI repository

Usage Examples

# Manual trigger for a weekly preview build to testpypi
# Navigate to Actions > Create Releases > Run workflow
# Select branch: main
# Set publish_testpypi_weekly: yes
# Set build_mode: preview

# Manual trigger for an official release
# Navigate to Actions > Create Releases > Run workflow
# Select branch: rel-1.16.0
# Set publish_pypi_release: yes
# Set build_mode: release

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment