Skip to content

Add release pipeline GitHub Action #3954

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

Merged
merged 5 commits into from
Jun 13, 2020

Conversation

michaelosthege
Copy link
Member

@michaelosthege michaelosthege commented Jun 11, 2020

Description

This PR adds a GitHub Action with a release pipeline.

I commented out a few blocks/lines to make the pipeline run on this PR. Which it doesn't, because the GitHub action does not activate before it's on master.

Before merging, the TODO lines (except the tests) MUST be addressed.

Also, a GitHub Action Secret must be created in the Settings of the GitHub repository:

image

The pipeline currently does not run tests. For now, we must not create release tags if the pipeline failed on master.

TODO

  • switch the on condition (will skip the pipeline from the last PR commit before merging, but run it when the release is created)
  • remove the export GITHUB_REF which is just there to simulate the creation of the release tag
  • add the PYPI_TOKEN secret as described above
  • enable the twine upload line
  • switch the pip install pymc3 line to the one that uses the released version

References

@michaelosthege
Copy link
Member Author

michaelosthege commented Jun 11, 2020

The steps from the pipeline can be tested in a Docker container:

git clone https://github.com/michaelosthege/pymc3
cd pymc3
git checkout add-action
git pull
docker run --rm -it -v $(pwd):/pymc3 --workdir=/pymc3 python:3.7 bash

Copy link
Contributor

@AlexAndorra AlexAndorra left a comment

Choose a reason for hiding this comment

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

This looks really helpful, thanks a lot @michaelosthege ! I think the Release Checklist should be updated accordingly.

@ericmjl
Copy link
Member

ericmjl commented Jun 12, 2020

@michaelosthege sorry for getting back so late on this! I wanted to raise a question - if we want tests to pass before deploy, and for it to deploy only on master, could we get this done instead on Travis? This would make sense, given that Travis is the CI service that is running tests for us.

I finally read the Travis docs on how to make it happen, and it looks very similar to how you've defined it using GitHub actions. This weekend I've made some time to dry-run a python package deploy, and can report back. (Sorry for the delay again, I was writing a long notebook on probability, for my own learning, all of the week.)

@michaelosthege
Copy link
Member Author

@ericmjl No, it doesn't work on travis (took me 4 hours to learn this when trying for pyrff).
The reason is because Travis has no way to provide secrets to a pipeline running on a non-master branch. Tag-triggered pipelines on Travis don't run on master, so they don't get the secrets.

I think it's fine that the pipeline doesn't run the tests. We just don't create a Release if the master pipeline is red.

Also, we have more pressing worries, like building docs.

@michaelosthege michaelosthege merged commit 2469ce5 into pymc-devs:master Jun 13, 2020
@michaelosthege michaelosthege deleted the add-action branch March 28, 2021 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants