Skip to content

Commit

Permalink
Publish dev releases to pypi.org
Browse files Browse the repository at this point in the history
This is a workaround for the fact that https://test.pypi.org/p/jsonobject
has been claimed by another project. Dev releases will not be downloaded
by pip unless the `--pre` argument is used, and the latest stable release
will be displayed on https://pypi.org/p/jsonobject by default.
  • Loading branch information
millerdev committed Feb 24, 2025
1 parent 65927e3 commit d498e56
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 27 deletions.
51 changes: 26 additions & 25 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
name: Upload release to PyPI
needs: [build_sdist, build_linux_wheels]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
#if: startsWith(github.ref, 'refs/tags/v') # removed until pypi-test-publish is working
environment:
name: pypi
url: https://pypi.org/p/jsonobject
Expand All @@ -109,27 +109,28 @@ jobs:
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

pypi-test-publish:
name: Upload release to test PyPI
needs: [build_sdist, build_linux_wheels]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/jsonobject
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
# with no name set, it downloads all of the artifacts
path: dist/
- run: |
mv dist/sdist/*.tar.gz dist/
mv dist/*-wheels/*.whl dist/
rmdir dist/{sdist,*-wheels}
ls -R dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# https://github.com/finpassbr/json-object/issues/1
#pypi-test-publish:
# name: Upload release to test PyPI
# needs: [build_sdist, build_linux_wheels]
# runs-on: ubuntu-latest
# environment:
# name: testpypi
# url: https://test.pypi.org/p/jsonobject
# permissions:
# id-token: write
# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v4
# with:
# # with no name set, it downloads all of the artifacts
# path: dist/
# - run: |
# mv dist/sdist/*.tar.gz dist/
# mv dist/*-wheels/*.whl dist/
# rmdir dist/{sdist,*-wheels}
# ls -R dist
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
4 changes: 2 additions & 2 deletions LIFECYCLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ Once this PR is reviewed and merged, move on to the steps to release the update
To push the package to pypi, create a git tag named "vX.Y.Z" using the version
in `jsonobject/__init__.py` and push it to Github.

A test release is pushed to test.pypi.com/projects/jsonobject on each push/merge
to master. A test release may also be published on-demand for any branch with
A dev release is pushed to pypi.com/p/jsonobject/#history on each push/merge to
master. A dev release may also be published on-demand for any branch with
[workflow dispatch](https://github.com/dimagi/jsonobject/actions/workflows/pypi.yml).

0 comments on commit d498e56

Please sign in to comment.