Skip to content

Commit

Permalink
try pypi workflow on release
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidcarbon committed Dec 12, 2024
1 parent 7201b35 commit 9779d8b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 10 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload built package as artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -29,7 +29,5 @@ include = [
"affinity.py",
]

[tool.hatch.build.targets.wheel]

[tool.ruff]
line-length = 88

0 comments on commit 9779d8b

Please sign in to comment.