Skip to content

try pypi workflow on release #40

try pypi workflow on release

try pypi workflow on release #40

Workflow file for this run

name: Build and Release Python Wheel
on:
push:
branches:
- main
jobs:
build-and-release:
if: contains(github.event.head_commit.message, 'release')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Hatch
run: pip install hatch
- name: Build
run: hatch build
- name: Create a Release
run: |
RELEASE_DATE=$(date +'%Y-%m-%d')
VERSION=$(cat pyproject.toml | cut -d'"' -f2)
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 }}
- name: Upload built package as artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/