Skip to content

Add automated release workflow #284

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 2 commits into from
Mar 22, 2021
Merged

Add automated release workflow #284

merged 2 commits into from
Mar 22, 2021

Conversation

ianhi
Copy link
Collaborator

@ianhi ianhi commented Jan 4, 2021

This would allow the building of the wheel and the uploads to pypi and NPM to happen automatically on making a new release on github.

If this gets merged then someone with rights to publish to those platforms will need to generate an API key and add it to this repos secrets.

again @martinRenou (sorry for sudden spam :/) but i'm hoping this one can make your life a bit easier when releasing :)

- name: Publish the Python package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

How are we supposed to generate and set this token?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For generating go to pypi-> account settings then scroll down to:
image

For setting you add it to the Secrets section of this repo in settings like so:
image

then it all sorta "just works"

if [[ $PRE_RELEASE == "true" ]]; then export TAG="next"; else export TAG="latest"; fi
npm publish --tag ${TAG} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

Same question here I guess :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same as pypi except token created on npm.js instead of pypi

@martinRenou
Copy link
Member

Thanks for the PR!

@ianhi
Copy link
Collaborator Author

ianhi commented Jan 4, 2021

Once the tokens are set then the release process becomes:

  1. manually bump version
  2. Draft a new release via github UI
  3. Publish that release

and it will even do the git tagging for you

@ianhi
Copy link
Collaborator Author

ianhi commented Jan 4, 2021

This is a near carbon copy of the juptyerlab-git version https://github.com/jupyterlab/jupyterlab-git/blob/master/.github/workflows/publish.yml

@martinRenou
Copy link
Member

I like more and more the idea of doing this. I would like to test it on a less-critical project first though. I might start with ipycanvas.

@ianhi
Copy link
Collaborator Author

ianhi commented Jan 8, 2021

I would like to test it on a less-critical project first though. I might start with ipycanvas.

Sensible. Feel free to just copy paste this PR over to there. Alternatively we can try it on ipycytoscape. I would have done that already (https://github.com/QuantStack/ipycytoscape/blob/master/.github/workflows/release.yml) but I don't have adequate permissions to add secrets to the repo

@martinRenou
Copy link
Member

Me neither. Maybe @marimeireles has those rights?

@martinRenou
Copy link
Member

I am not allowed to set up secrets on ipympl. Which makes sense.

@tacaswell would you be able to create the secret tokens for publishing to PyPi and npmjs?

I'll do the next release manually.

@marimeireles
Copy link

Sorry, I missed this.
I just checked I don't have permission to add secrets.
@SylvainCorlay adding these secrets would automate the release of ipycytoscape a bit, could you give these permissions to Ian or me?

@ianhi
Copy link
Collaborator Author

ianhi commented Mar 18, 2021

Hi @tacaswell would you be ok with adding the necessary secrets? This would make it super easy to do things like release immediately after merging: #310

Also fwiw pypi token can be scoped by package, but npmjs cannot and give access to all packages.

@ianhi
Copy link
Collaborator Author

ianhi commented Mar 18, 2021

Automated releases have been tested out for both ipycanvas and jupyterlab-sidecar now and seems to work for both.

@tacaswell
Copy link
Member

I suspect I have access to add the secrets on the GH side, but do not have access to get them on the pypi side!

That said, if I can, I am happy to pull levers and push buttons as required.

@ianhi
Copy link
Collaborator Author

ianhi commented Mar 22, 2021

The tests won't detect anything here. So going with a merge. Only way to check is to try releasing.

@ianhi ianhi merged commit 67c8c15 into matplotlib:master Mar 22, 2021
@ianhi ianhi deleted the auto-release branch March 22, 2021 22:13
@Isuruvh
Copy link

Isuruvh commented May 24, 2025

Need to add automated release call flow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants