-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Deploy to Jazzband package index from Travis CI #57
Conversation
To be clear, no Jazzband so far has used GitHub actions to do this, but always the recommended Travis CI integration. So there may be some debugging needed to get this right. Regarding the use of the Test PyPI, I'm not sure if this is needed given the use of the Jazzband package index to do the releases. Project leads will need to review and confirm releases before they are pushed from the Jazzband package index to PyPI. |
Co-authored-by: Jannis Leidel <jannis@leidel.info>
Shall we just switch over to Travis then? There's not a huge gain for deploying from GHA (other than to be using the new thing). Especially if there's a lot on your plate we don't need to spend time debugging when Travis is know to deploy well. If so, like this in deploy:
provider: pypi
user: jazzband
server: https://jazzband.co/projects/prettytable/upload
distributions: sdist bdist_wheel
password:
secure: svV4fYtodwW+iTyFOm5ISEfhVwcA+6vTskD3x6peznc40TdMV9Ek8nT3Q/NB4lCbXoUw2qR4H6uhLCjesnv/VvVk/qbitCyD8ySlgwOV5n7NzJs8lC8EYaHSjGQjatTwJAokfGVYkPawkI7HXDqtDggLUQBK+Ag8HDW+XBSbQIU=
on:
tags: true
repo: jazzband/prettytable
python: 3.8
Yeah, let's skip it when using Jazzband package index.
|
That would be preferable to me, yeah.
That should be right, I can update the upload secret once you've updated the PR.
Cool, thank you! |
PR updated! |
@jezdez Hi, I just pushed a tagged commit and the deploy failed:
https://travis-ci.org/github/jazzband/prettytable/jobs/732271558#L439 I've restarted the job and the same thing happened. Before tagging, I'd made this tweak (d65f0d5) to |
Thanks, something is wrong with the credentials, I think. Looking at the logs right now. |
Glad you get to see this fail, despite having gotten countless releases from other Jazzband projects ;) |
@hugovk Ok, I've deployed a work-around until I get off of uWSGI. Can you retry the run on Travis? |
Also good we didn't throw GitHub Actions into the mix as another variable! I restarted it and got the same thing:
https://travis-ci.org/github/jazzband/prettytable/jobs/732271558 |
Okay, I got rid of uWSGI and deployed gunicorn instead, could you please try again? |
Same thing:
https://travis-ci.org/github/jazzband/prettytable/jobs/732271558#L456 |
Okay I think that fixed one problem, now to the other, I want to make sure the deploy key is correct, could you re-tag with the change I added to master please? 1.0.0...master I'm sorry for all of this kerfuffle, I'm embarrassed this is happening, but other releases have worked fine, I wonder it's a PEBKAC. |
No problem, these things happen! Same thing again: https://travis-ci.org/github/jazzband/prettytable/jobs/732592087#L456 New tag: https://github.com/jazzband/prettytable/releases/tag/1.0.0 |
So I'm thinking the |
@hugovk Soo, how do you feel to retrying the GH action integration? If you're using the |
@hugovk I've added the release key to the repo secrets as |
Okay, let's try it! It didn't work on the first try: I created https://github.com/jazzband/prettytable/blob/master/.github/workflows/deploy.yml containing: name: Deploy
on:
push:
branches:
- master
release:
types:
- published
jobs:
build:
if: github.repository == 'jazzband/prettytable'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: deploy-${{ hashFiles('**/setup.py') }}
restore-keys: |
deploy-
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*
- name: Publish package to Jazzband
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/prettytable/upload Then deleted the old
https://github.com/jazzband/prettytable/runs/1206092655?check_suite_focus=true That warning won't apply to the Jazzband PI. Just to double check, is |
Yeah, for consistency sake upper case is correct, I've created it upper-case for certain. The issue is that the username needs to be |
If this works, I think I'll create a GitHub action to do this which we can use for all Jazzband projects, it's just so silly how I have to do this dance so often for Jazzband projects. And Travis has been acting up for a while now.. |
Huzzah!! https://jazzband.co/projects/prettytable#1.0.0 🎊 🍾 |
@hugovk You should have received an email explaining the rest of the process, don't forget to release both files per version, I'll work on the ability to release all files of a version soon. |
3f226d4 and success!
Thanks! |
Yes, got the email (actually 3 emails: 2 for whl and one for sdist, and you got them too). I released the first and got this error: But the tar.gz was at PyPI: https://pypi.org/project/prettytable/#files Then went back and did the .whl (no error) and now they're both there. https://jazzband.co/projects/prettytable#1.0.0 shows a prettytable-1.0.0.tar.gz Anyway, the main thing is we got a new release out after seven years! Thanks again! |
Yah, both are known issues that showed up over time and I had no time debugging them so far. Retrying the release of the tarball should make it work, this is something about Docker syncing the files not correctly via the volume release files are stored with. |
@hugovk I've fixed the issue of the releases and took the liberty to push the 1.0 tarball to PyPI since I didn't have another good way to reproduce this. Long story short, the issue was related to PyPI's more aggressively caching the JSON API than in the past that the Jazzband website uses to confirm that the deploy to PyPI was successful. I'm using a timestamp in the URL now to cache-bust the call to the PyPI project JSON API. |
Thanks! I'll probably make an update release this week and will let you know how it goes! |
🚀 I just released 1.0.1, there was just a single tarball and a single wheel (as expected), and they both released to PyPI from Jazzband smoothly! 👍 |
Thanks for letting me know @hugovk! |
For #18.
This will:
TODO
Create API tokens (https://pypi.org/help/#apitoken) and save at GitHub Actions:
prettytable-ci
at https://test.pypi.org/manage/account/token/test_pypi_password
at https://github.com/jazzband/prettytable/settings/secrets/newprettytable-ci
at https://pypi.org/manage/account/token/pypi_password
at https://github.com/jazzband/prettytable/settings/secrets/newI can do (1) and (3), but don't have access to https://github.com/jazzband/prettytable/settings/secrets/new to do (2) or (4).
@flaper87 Do you have access to https://github.com/jazzband/prettytable/settings/secrets/new, or is this also a roadie-only task?