Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: release
# Publishes to PyPI via trusted publishing (OIDC) when you push a tag like v1.2.0. No API token is stored.
# One-time setup on pypi.org -> your project -> Publishing: owner Pyhroff, repo ModelHawk, workflow release.yml, environment pypi.
on:
push:
tags: ["v*"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.11"
- run: pip install build twine
- run: python -m build
- run: twine check dist/*
- name: Tag must match package version
run: |
v=$(python - <<'PY'
import tomllib; print(tomllib.load(open("pyproject.toml","rb"))["project"]["version"])
PY
)
test "v$v" = "$GITHUB_REF_NAME" || { echo "tag $GITHUB_REF_NAME != version v$v"; exit 1; }
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: dist
path: dist/
publish:
needs: build
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: dist
path: dist/
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ PWNED.txt
!.env.example
*.key
*.pem

# Build output
*.egg-info/
build/
dist/
290 changes: 0 additions & 290 deletions modelhawk.egg-info/PKG-INFO

This file was deleted.

10 changes: 0 additions & 10 deletions modelhawk.egg-info/SOURCES.txt

This file was deleted.

1 change: 0 additions & 1 deletion modelhawk.egg-info/dependency_links.txt

This file was deleted.

2 changes: 0 additions & 2 deletions modelhawk.egg-info/entry_points.txt

This file was deleted.

1 change: 0 additions & 1 deletion modelhawk.egg-info/top_level.txt

This file was deleted.

Loading