From e378a6660aab636a112e1efd577e532e32156d4f Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Fri, 2 Jun 2023 20:25:36 +0200 Subject: [PATCH] Split build & release further. --- .github/workflows/ci.yml | 3 --- .github/workflows/pypi-package.yml | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2735870..3197424 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,8 +115,6 @@ jobs: - uses: actions/checkout@v3 - name: Setup Python uses: actions/setup-python@v4 - with: - python-version: "3.8" - name: Check release id: check_release run: | @@ -136,4 +134,3 @@ jobs: autopub prepare autopub build autopub commit - autopub githubrelease diff --git a/.github/workflows/pypi-package.yml b/.github/workflows/pypi-package.yml index 05df97b..2029eb6 100644 --- a/.github/workflows/pypi-package.yml +++ b/.github/workflows/pypi-package.yml @@ -2,9 +2,8 @@ name: Build & upload PyPI package on: - release: - types: - - published + push: + tags: ["*"] jobs: build-package: @@ -22,14 +21,18 @@ jobs: release-pypi: name: Publish released package to pypi.org - environment: release-pypi # TODO: how to name the env - if: github.event.action == 'published' + environment: Deployment runs-on: ubuntu-latest needs: build-package permissions: id-token: write + contents: write steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v4 + - name: Download packages built by build-and-inspect-python-package uses: actions/download-artifact@v3 with: @@ -40,3 +43,8 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: repository-url: https://test.pypi.org/legacy/ # TODO: Move over to actual PyPI + + - name: Create Github release + run: | + pip install autopub[github] + autopub githubrelease