From 3da0de2a5029f9704d7ef19b0dd8c1de7381e081 Mon Sep 17 00:00:00 2001 From: Vladimir <18351400+en9inerd@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:59:21 -0400 Subject: [PATCH] fix: fix ga workflow --- .github/workflows/publish_release.yml | 24 +++++++++++++++++++++--- pyproject.toml | 10 +++++++++- tgeraser/__version__.py | 2 +- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index b2cb0e1..f73bde8 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -9,14 +9,32 @@ jobs: release: runs-on: ubuntu-latest concurrency: release + permissions: + id-token: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 + # This action uses Python Semantic Release v8 - name: Python Semantic Release - uses: relekang/python-semantic-release@master + id: release + uses: python-semantic-release/python-semantic-release@v8.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} + # NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true. + # See https://github.com/actions/runner/issues/1173 + if: steps.release.outputs.released == 'true' + + - name: Publish package distributions to GitHub Releases + uses: python-semantic-release/upload-to-gh-release@main + if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} - pypi_token: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 07de284..7fd960b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,11 @@ [build-system] requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" + +[tool.semantic_release] +version_variables = [ + "tgeraser/__version__.py:VERSION", +] + +[tool.semantic_release.remote.token] +env = "GH_TOKEN" diff --git a/tgeraser/__version__.py b/tgeraser/__version__.py index c1b5a22..a6c1cf2 100644 --- a/tgeraser/__version__.py +++ b/tgeraser/__version__.py @@ -2,4 +2,4 @@ Version file """ -VERSION = "1.1.2" +VERSION = "1.2.0"