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

Add GH workflow to build and release on GH and PyPI #1946

Merged
merged 8 commits into from
Apr 21, 2022

Commits on Apr 6, 2022

  1. build: add GH workflow to build + release on PyPI

    Add workflow with two jobs to build and publish on PyPI.  The
    release job waits for the build job and uses a custom release
    environment, which can be configured to require review.
    
    To share the build artifacts between the jobs and to make them
    available for intermediate review, they are stored using
    'actions/upload-artifact' and 'actions/download-artifact'.
    https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
    
    To upload the build artifacts to PyPI, the PyPA recommended
    'pypa/gh-action-pypi-publish' is used.
    https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
    
    **Caveat**
    The URL to grab the artifacts, e.g. for review, requires knowledge
    of action ID and artifact ID, and a login token (no special
    permissions). This makes it a bit cumbersome to fetch the artifacts
    with a script and compare them to a local build.
    https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts
    
    Signed-off-by: Lukas Puehringer <[email protected]>
    lukpueh committed Apr 6, 2022
    Configuration menu
    Copy the full SHA
    faef040 View commit details
    Browse the repository at this point in the history
  2. build: update CD workflow to create GH release

    - Create preliminary GitHub release (X.Y.Z-rc) in 'build' job,
      using popular 3rd-party 'softprops/action-gh-release'.
    - Finalize GH release in 'release' job using custom GH script.
    
    Signed-off-by: Lukas Puehringer <[email protected]>
    lukpueh committed Apr 6, 2022
    Configuration menu
    Copy the full SHA
    5bfe897 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2022

  1. build: update CI/CD workflow to run in series

    - Change CI workflow to also run on push to (release) tag
    - Change CD workflow to run on successful CI run, and only if a
      (release) tag push triggered the CI
    
    NOTE: Unfortunately the setup is not very robust
          (see code comment in cd.yml)
    
    Signed-off-by: Lukas Puehringer <[email protected]>
    lukpueh committed Apr 7, 2022
    Configuration menu
    Copy the full SHA
    a1a71c1 View commit details
    Browse the repository at this point in the history
  2. build: lint 'verify_release' with tox

    Enable tox to lint 'verify_release' script and fix:
    - whitespace
    - unused import (we only import here to see if the module is
      available for use in a subprocess)
    - unfound import (same as unused import)
    
    Signed-off-by: Lukas Puehringer <[email protected]>
    lukpueh committed Apr 7, 2022
    Configuration menu
    Copy the full SHA
    a76ed28 View commit details
    Browse the repository at this point in the history
  3. build: add skip-pypi flag to verify_release script

    Add '--skip-pypi' flag to 'verify_release' script to allow for
    pre-release checks, when the automatic build job has uploaded the
    build assets to GitHub and is awaiting review/approval in order to
    upload it to PyPI eventually.
    
    Signed-off-by: Lukas Puehringer <[email protected]>
    lukpueh committed Apr 7, 2022
    Configuration menu
    Copy the full SHA
    4f275ad View commit details
    Browse the repository at this point in the history
  4. doc: describe auto release workflow in RELEASE.md

    Change RELEASE.md to include instructions to trigger and review
    auto release workflow (CI/CD).
    
    Signed-off-by: Lukas Puehringer <[email protected]>
    lukpueh committed Apr 7, 2022
    Configuration menu
    Copy the full SHA
    37cb272 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2022

  1. doc: describe repo setup in RELEASE.md + typos fix

    Signed-off-by: Lukas Puehringer <[email protected]>
    lukpueh committed Apr 20, 2022
    Configuration menu
    Copy the full SHA
    674eb9d View commit details
    Browse the repository at this point in the history
  2. build: minor updates in CI/CD workflow files

    - polish code comments
    - wrap long lines
    
    Signed-off-by: Lukas Puehringer <[email protected]>
    lukpueh committed Apr 20, 2022
    Configuration menu
    Copy the full SHA
    b99d043 View commit details
    Browse the repository at this point in the history