build: redo publish to pypi

This commit is contained in:
Brian May 2025-02-08 09:36:48 +11:00
parent 5b08caaeb1
commit fd6b6bb71f
No known key found for this signature in database
GPG Key ID: 2A92599257644AFA
2 changed files with 34 additions and 10 deletions

View File

@ -3,28 +3,53 @@ on:
branches:
- master
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }}
release-type: python
upload-pypi:
name: Upload to pypi
needs: [release-please]
# if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sshuttle
permissions:
id-token: write
steps:
- name: Publish PyPi package
uses: code-specialist/pypi-poetry-publish@v1
with:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_REGISTRY_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Run image
uses: abatilo/actions-poetry@v4
with:
poetry-version: main
- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Package project
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

View File

@ -109,7 +109,6 @@ It is also possible to install into a virtualenv as a non-root user.
nix-env -iA nixpkgs.sshuttle
- Windows::
Use PyPI
pip install sshuttle