From 16941ad96fbf81603bd505d9f4a96b6cb0b737a1 Mon Sep 17 00:00:00 2001 From: david-i-berry Date: Wed, 21 Aug 2024 16:59:48 +0200 Subject: [PATCH] build python from local. --- .../{release.yml => publish-ghcr.yml} | 25 +------------ .github/workflows/publish-pypi.yml | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 24 deletions(-) rename .github/workflows/{release.yml => publish-ghcr.yml} (79%) create mode 100644 .github/workflows/publish-pypi.yml diff --git a/.github/workflows/release.yml b/.github/workflows/publish-ghcr.yml similarity index 79% rename from .github/workflows/release.yml rename to .github/workflows/publish-ghcr.yml index deab897..413aacc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/publish-ghcr.yml @@ -1,9 +1,8 @@ name: release on: - push: release: - types: [publish] + types: [published] permissions: contents: read @@ -16,28 +15,6 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: - #pypi-build-dist-artefacts-and-publish: - # runs-on: ubuntu-latest - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 - - # - name: Setup pyenv - # run: | - # python -m pip install build twine - - # - name: Build and publish - # env: - # TWINE_USERNAME: __token__ - # TWINE_PASSWORD: ${{ secrets.PYPI_PWD }} - # run: | - # # build - # echo "Building ..." - # python -m build - # # use twine - # echo "Uploading ..." - # twine upload -r testpypi dist/* - ghcr-build-and-publish: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..c0a9c35 --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,35 @@ +name: release + +on: + release: + types: [published] + +permissions: + contents: read + packages: write + issues: write + pull-requests: write + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PWD }} + +jobs: + pypi-build-dist-artefacts-and-publish: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup pyenv + run: | + python -m pip install build twine + - name: Build and publish + run: | + # build + echo "Building ..." + python -m build + # use twine + echo "Uploading ..." + twine upload dist/* \ No newline at end of file