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

Automatically publish version tags to PyPI via GH Actions #107

Merged
merged 5 commits into from Dec 11, 2019

Conversation

CasperWA
Copy link
Member

@CasperWA CasperWA commented Dec 6, 2019

This is blocked until #92 has been merged and needs to be rebased. Currently, only the last four commits are related to this PR.

Introduce a new workflow for publishing on PyPI via GitHub Actions.
The workflow steps:

  • Run for pushes on tags (no matter if on master branch or not).
    • Run only if repository is 'Materials-Consortia/optimade-python-tools'
    • Run for tags of 'v[0-9]+.[0-9]+.[0-9]+*
      The last * makes it possible to tag alpha, beta, and release candidate versions. Basically it means the workflow will run with anything after the initial part of the tag name has been verified.
  • Checkout repository, install Python 3.7, and update setuptools and install optimade with base dependencies (pip install -e .).
  • Assert package version equals tag name, i.e., "v" + __version__ matches the pushed tag name.
    • If this does not fail, print a helpful message. Most importantly one MUST remove the newly created tag from GitHub and the local repository.
  • Build source distribution.
  • Upload/publish to TestPyPI.
    • This is to check that uploading to PyPI works and that the version does not already exist on PyPI, since this will make the upload fail.
  • Finally, upload/publish to PyPI.

@CasperWA CasperWA added the enhancement New feature or request label Dec 6, 2019
@CasperWA CasperWA changed the title [BLOCKED] Automatically publish version tags to PyPI via GH Actions Automatically publish version tags to PyPI via GH Actions Dec 7, 2019
Commented out a step to publish on TestPyPI.
alpha, beta, and release candidate version cannot be recognized by the
GitHub Actions regex at this point, so they are not allowed.
Update tasks and various error-messages.
Publish to TestPyPI before publishing to PyPI. This is to make sure we
can successfully upload to PyPI to begin with.
Copy link
Member

@ml-evs ml-evs left a comment

Choose a reason for hiding this comment

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

Cheers for this @CasperWA! Hard to test, but everything here looks sensible and self-verifying. Will leave it to you to merge in whatever order you want.

@CasperWA CasperWA merged commit 160951a into Materials-Consortia:master Dec 11, 2019
@CasperWA CasperWA deleted the test_release branch December 11, 2019 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants