From 38c2a0a9c55475fbe9a690a886c51e9c4c8085bc Mon Sep 17 00:00:00 2001 From: Lennart Weller Date: Fri, 27 Dec 2024 21:11:04 +0000 Subject: [PATCH] fix: publish with oidc --- .devcontainer/devcontainer.json | 2 +- .github/workflows/pythonpublish.yml | 31 +++++++++++++++++++---------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ef0b1aa..19deb63 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ { "name": "aiocloudweather", - "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm", + "image": "mcr.microsoft.com/devcontainers/python:1-3.13-bookworm", "postCreateCommand": "pip3 install -e .", "runArgs": [ "-e", diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index b432295..c020c6d 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -8,10 +8,8 @@ on: types: [published] jobs: - deploy: - + build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Set up Python @@ -20,13 +18,26 @@ jobs: python-version: '3.x' - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine + python -m pip install --upgrade pip build - name: Build and publish env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - PACKAGE_VERSION: ${{ github.event.release.name }} + PACKAGE_VERSION: ${{ github.event.release.tag_name }} run: | - python setup.py sdist bdist_wheel - twine upload dist/* \ No newline at end of file + python -m build + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + publish: + runs-on: ubuntu-latest + needs: build + steps: + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 \ No newline at end of file