Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: start with pipeline for official release (without manual steps) #5939

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
40 changes: 38 additions & 2 deletions .github/workflows/release_linux_aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
# Run weekly on Monday 00:00
- cron: '00 00 * * MON'
push:
branches: [main, rel-*]
branches: [main, rel-*, create_release_directly_from_pipeline]
pull_request:
branches: [main, rel-*]
workflow_dispatch:
release:
types: [published]

permissions: # set top-level default permissions as security best practice
contents: read
Expand Down Expand Up @@ -77,7 +79,7 @@ jobs:

- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: wheels
name: wheels2
path: dist

- name: Upload wheel to PyPI weekly
Expand Down Expand Up @@ -124,3 +126,37 @@ jobs:
export ORT_MAX_ONNX_OPSET_SUPPORTED_VERSION=20 \
pytest && \
deactivate'


release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/v')
needs: [build]
steps:
- uses: actions/download-artifact@348754975ef0295bfa2c111cba996120cfdf8a5d
with:
name: wheels2
path: dist/

# - name: Publish wheels to pypi
# uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
# with:
# password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create GitHub Release (add artifacts to )
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create ''${{ github.ref_name }}' --repo '${{ github.repository }}' --notes ""

- name: Upload artifact signatures to GitHub Release # TODO: 1) don't upload wheels?, what is in dist/* ? 2) how is tar.gz/zip added?

env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload '${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
38 changes: 37 additions & 1 deletion .github/workflows/release_linux_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
# Run weekly on Monday 00:00
- cron: '00 00 * * MON'
push:
branches: [main, rel-*]
branches: [main, rel-*, create_release_directly_from_pipeline]
pull_request:
branches: [main, rel-*]
workflow_dispatch:
release:
types: [published]

permissions: # set top-level default permissions as security best practice
contents: read
Expand Down Expand Up @@ -98,3 +100,37 @@ jobs:
export ORT_MAX_ML_OPSET_SUPPORTED_VERSION=3
export ORT_MAX_ONNX_OPSET_SUPPORTED_VERSION=20
pytest


release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/v')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need the commit to be in an rel-* branch I think?

needs: [build]
steps:
- uses: actions/download-artifact@348754975ef0295bfa2c111cba996120cfdf8a5d
with:
name: wheels
path: dist/

- name: Publish wheels to pypi
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create GitHub Release # TODO: notes?
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create ''${{ github.ref_name }}' --repo '${{ github.repository }}' --notes ""
Comment on lines +121 to +125
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can assume a release has been created when this pipeline is triggered, because we use the release feature to create the tag.


- name: Upload artifact signatures to GitHub Release # TODO: 1) don't upload wheels?, what is in dist/* ? 2) how is tar.gz/zip added?

env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload '${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
34 changes: 34 additions & 0 deletions .github/workflows/release_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,37 @@ jobs:
export ORT_MAX_ML_OPSET_SUPPORTED_VERSION=3
export ORT_MAX_ONNX_OPSET_SUPPORTED_VERSION=20
pytest


release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/v')
needs: [build]
steps:
- uses: actions/download-artifact@348754975ef0295bfa2c111cba996120cfdf8a5d
with:
name: wheels
path: dist/

- name: Publish wheels to pypi
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create GitHub Release # TODO: notes?
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create ''${{ github.ref_name }}' --repo '${{ github.repository }}' --notes ""

- name: Upload artifact signatures to GitHub Release # TODO: 1) don't upload wheels?, what is in dist/* ? 2) how is tar.gz/zip added?

env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload '${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
2 changes: 1 addition & 1 deletion docs/OnnxReleases.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The ONNX project, going forward, will plan to release roughly on a four month ca

## Preparation
* Install Twine, a utility tool to interact with PyPI. Do - ``pip install twine``
* Get hold of the username and password for the ‘onnx’ PyPI account. Release manager should get onnx pypi account credentials from steering committee or from previous release manager.
* ~~Get hold of the username and password for the ‘onnx’ PyPI account. Release manager should get onnx pypi account credentials from steering committee or from previous release manager.~~ (New ways: The wheels should be uploaded by the pipeline directly when a tag is created)
* Bump the LAST_RELEASE_VERSION in [version.h](/onnx/common/version.h). Make sure that the IR version number and opset version numbers are up-to-date in
[ONNX proto files](/onnx/onnx.in.proto),
[Versioning.md](Versioning.md),
Expand Down