diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4664f48..48ba6d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,26 +69,26 @@ jobs: name: dist path: dist/ -# pypi_publish: -# name: Upload release to PyPI -# needs: [build_package] -# if: needs.build_package.outputs.new_version -# runs-on: ubuntu-latest -# environment: -# name: release -# url: https://pypi.org/p/${{ env.PACKAGE_NAME }} -# permissions: -# id-token: write -# steps: -# - name: Download artifacts -# uses: actions/download-artifact@v3 -# with: -# name: dist -# path: dist/ -# -# - name: Publish distribution to PyPI -# uses: pypa/gh-action-pypi-publish@release/v1 -# + pypi_publish: + name: Upload release to PyPI + needs: [build_package] + if: needs.build_package.outputs.new_version + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/${{ env.PACKAGE_NAME }} + permissions: + id-token: write + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + github_tag: name: Create GitHub tag needs: [build_package] @@ -109,28 +109,28 @@ jobs: sha: context.sha }) -# github_release: -# name: Create GitHub Tag aRelease -# needs: [build_package] -# runs-on: ubuntu-latest -# permissions: -# contents: write -# steps: -# - name: Checkout Code -# uses: actions/checkout@v3 -# with: -# fetch-depth: 0 -# -# - name: Download artifacts -# uses: actions/download-artifact@v3 -# with: -# name: dist -# path: dist/ -# -# - name: Create GitHub Release -# id: create_release -# env: -# GH_TOKEN: ${{ github.token }} -# run: | -# tag_name = ${{ needs.build_package.outputs.new_version }} -# gh release create ${tag_name} dist/* --title ${tag_name} --generate-notes + github_release: + name: Create GitHub Tag aRelease + needs: [build_package] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + + - name: Create GitHub Release + id: create_release + env: + GH_TOKEN: ${{ github.token }} + run: | + tag_name=${{ needs.build_package.outputs.new_version }} + gh release create ${tag_name} dist/* --title ${tag_name} --generate-notes diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..469fef6 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +VERSION = "0.6.2" diff --git a/pyproject.toml b/pyproject.toml index 0b7a782..9da3b04 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "sliplib" -version = "0.6.3" +dynamic = ["version"] description = "Slip package" readme = "README.rst" license = "MIT" @@ -36,6 +36,10 @@ dependencies = [] [project.urls] "Source code" = "https://github.com/rhjdjong/SlipLib" +[tool.hatch.version] +path = "VERSION" +#pattern = "VERSION = (?P.*)$" + [tool.hatch.build.targets] packages = ["src/sliplib"]