From a29ecb4dbb1060086e6a607644a3bbdfabc89b09 Mon Sep 17 00:00:00 2001 From: Luca Marconato Date: Fri, 3 Jan 2025 21:09:09 +0100 Subject: [PATCH] improved release process --- .github/workflows/build.yaml | 23 ----------------------- .github/workflows/release.yaml | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index 02429433..00000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Check Build - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - package: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.10 - uses: actions/setup-python@v2 - with: - python-version: "3.10" - - name: Install build dependencies - run: python -m pip install --upgrade pip wheel twine build - - name: Build package - run: python -m build - - name: Check package - run: twine check --strict dist/*.whl diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1aa90822..299ed867 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,26 +5,26 @@ on: types: [published] jobs: - release: - # requires that you have put your twine API key in your - # github secrets (see readme for details) + package_and_release: runs-on: ubuntu-latest - if: contains(github.ref, 'tags') + if: startsWith(github.ref, 'refs/tags/v') steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Python 3.10 + - uses: actions/checkout@v3 + - name: Set up Python 3.12 uses: actions/setup-python@v4 with: - python-version: "3.10" - + python-version: "3.12" + cache: pip + - name: Install build dependencies + run: python -m pip install --upgrade pip wheel twine build + - name: Build package + run: python -m build + - name: Check package + run: twine check --strict dist/*.whl - name: Install hatch run: pip install hatch - - name: Build project for distribution run: hatch build - - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: