diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30435f1f..ddcaf250 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,8 @@ name: upload release to PyPI on: - workflow_dispatch: + release: + types: + - published jobs: pypi-publish: @@ -12,22 +14,20 @@ jobs: contents: write steps: - uses: actions/checkout@v4.2.2 - - uses: actions/setup-python@v5.4.0 with: - python-version: ">=3.10" - - name: Get version - run: | - echo "version=$(date +'%Y.%m.%d.%H.%M')" >> "$GITHUB_ENV" - - name: Tag and release - env: - GH_TOKEN: ${{ github.token }} + fetch-depth: 0 + fetch-tags: true + + - uses: actions/setup-python@v5.3.0 + with: + python-version: 3.12 + + - name: Install build run: | - git tag $version - git push origin $version - pip install poetry - poetry self add poetry-dynamic-versioning[plugin] - poetry install --sync - poetry build - gh release create --generate-notes $version ./dist/* + pip install poetry + poetry self add poetry-dynamic-versioning[plugin] + poetry sync + poetry build + - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml index 3d44a014..8a2c7d7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" license = "Apache License" [build-system] -requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +requires = ["poetry-core", "poetry-dynamic-versioning"] build-backend = "poetry_dynamic_versioning.backend" [tool.poetry-dynamic-versioning]