From 1c6cf78340e81265afc47b3e9589033ff7626fd6 Mon Sep 17 00:00:00 2001 From: chrishavlin Date: Fri, 4 Oct 2024 14:41:06 -0500 Subject: [PATCH] build/test on tag push, single source version --- .github/workflows/build_and_publish.yaml | 20 +++++++++++++++++++- .github/workflows/run_tests.yaml | 8 ++++++-- pyproject.toml | 6 +++++- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_and_publish.yaml b/.github/workflows/build_and_publish.yaml index ef54b13..e64a868 100644 --- a/.github/workflows/build_and_publish.yaml +++ b/.github/workflows/build_and_publish.yaml @@ -5,11 +5,13 @@ on: workflow_dispatch: release: types: - - created - published pull_request: paths: - .github/workflows/build_and_publish.yaml + push: + tags: + - 'v*' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -64,6 +66,22 @@ jobs: name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: wheelhouse/*.whl + create_gh_draft_release: + needs: [build_wheels, make_sdist] + runs-on: ubuntu-latest + permissions: + contents: write + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + steps: + - uses: actions/checkout@v4 + - uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + draft: true + tag: ${{ github.ref }} + prerelease: false + name: Release ${{ github.ref }} + upload_all: needs: [build_wheels, make_sdist] environment: pypi diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml index 022313b..ae7c3ac 100644 --- a/.github/workflows/run_tests.yaml +++ b/.github/workflows/run_tests.yaml @@ -1,6 +1,10 @@ name: Run tests -on: [pull_request] - +on: + workflow_dispatch: + pull_request: + push: + tags: + - 'v*' jobs: build: runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index 9faadff..1ebfb2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ build-backend = "setuptools.build_meta" [project] name = "yt_experiments" -version = "0.1.0" authors = [ { name="The yt project", email="yt-dev@python.org"}, ] @@ -18,6 +17,11 @@ classifiers = [ "License :: OSI Approved :: BSD License", ] dependencies=['yt>4.2.0', 'numpy'] +dynamic = ["version"] + +[tool.setuptools.dynamic] +version = {attr = "yt_experiments.__version__"} + [project.readme] file = "README.md"