From fd6b6bb71fd2270c13352b22c124b9d6f4cb571b Mon Sep 17 00:00:00 2001 From: Brian May Date: Sat, 8 Feb 2025 09:36:48 +1100 Subject: [PATCH] build: redo publish to pypi --- .github/workflows/release-please.yml | 43 ++++++++++++++++++++++------ README.rst | 1 - 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 2766600..8679033 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -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 diff --git a/README.rst b/README.rst index d268ed2..73f1214 100644 --- a/README.rst +++ b/README.rst @@ -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