diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml new file mode 100644 index 0000000..5f8732b --- /dev/null +++ b/.github/workflows/pypi_publish.yml @@ -0,0 +1,20 @@ +name: Publish to PyPI + +on: + release: + types: + - created + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: dist + path: ./dist/ + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.12.3 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2f66b73..a9348b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,17 +17,22 @@ jobs: - name: Install Hatch run: pip install hatch - - name: Build the wheel + - name: Build run: hatch build - name: Create a Release run: | RELEASE_DATE=$(date +'%Y-%m-%d') - COMMIT_SHA=$(git rev-parse --short HEAD) - UNIQUE_TAG="${RELEASE_DATE}-${COMMIT_SHA}" + VERSION=$(cat pyproject.toml | cut -d'"' -f2) - gh release create "${UNIQUE_TAG}" dist/affinity-*.whl --title "Release ${UNIQUE_TAG}" - git tag -f latest - git push origin latest --force + gh release create "${UNIQUE_TAG}" dist/affinity-*.whl --title "Release ${VERSION} (${RELEASE_DATE})" + # git tag -f latest + # git push origin latest --force env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload built package as artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8934e7d..9690ffd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "affinity" -version = "0.8.2" +version = "0.8.3" description = "Module for creating well-documented datasets, with types and annotations." authors = [ { name = "Alex Kislukhin" } @@ -29,7 +29,5 @@ include = [ "affinity.py", ] -[tool.hatch.build.targets.wheel] - [tool.ruff] line-length = 88