Skip to content

Create Releases

Create Releases #2

# Copyright (c) ONNX Project Contributors
#
# SPDX-License-Identifier: Apache-2.0
name: Create Releases
on:
schedule:
# Run weekly on Monday 00:00 UTC
- cron: '00 00 * * MON'
push:
branches: [main, rel-*]
pull_request:
branches: [main, rel-*]
types:
- labeled # Trigger when a label is added to a PR, more information: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
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']
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
uses: ./.github/workflows/release_linux_x86_64.yml
with:
os: "linux_x86_64"
secrets: inherit
call-workflow-ubuntu_aarch64:
strategy:
matrix:
os: ['ubuntu-latest']
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
uses: ./.github/workflows/release_linux_aarch64.yml
with:
os: "linux_aarch64"
secrets: inherit
call-workflow-win:
strategy:
matrix:
os: ['windows-latest']
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
uses: ./.github/workflows/release_win.yml
with:
os: "win"
secrets: inherit
call-workflow-mac:
strategy:
matrix:
os: ['mac-latest']
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run release CIs')
uses: ./.github/workflows/release_mac.yml
with:
os: "macos"
secrets: inherit
publish_to_testpypi:
name: Publish to testpypi, onnx-weekly
runs-on: ubuntu-latest
needs: [call-workflow-ubuntu_x86, call-workflow-ubuntu_aarch64, call-workflow-mac, call-workflow-win]
if: ${{ always() }} # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-not-requiring-successful-dependent-jobs
environment:
name: testpypi
url: https://test.pypi.org/p/onnx-weekly
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
steps:
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
if: (github.event_name == 'schedule') && ((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'))
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