File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Example:
2+ # - https://github.com/pallets/flask/blob/main/.github/workflows/tests.yaml
3+ # TODO:
4+ # GH release
5+ # Environment protection
6+ # - https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment
7+ # Separate build & release
8+
9+ name : PyPI publish
10+
11+
12+ on :
13+ push :
14+ tags :
15+ - ' v*.*.*'
16+ workflow_dispatch :
17+
18+
19+ jobs :
20+ build :
21+ name : Build and publish
22+
23+ runs-on : ubuntu-latest
24+
25+ # TODO: recommended best practice
26+ # environment:
27+ # name: pypi-publish
28+ # url: ...
29+
30+ permissions :
31+ # required for pypa/gh-action-pypi-publish
32+ id-token : write
33+
34+ steps :
35+ - uses : actions/checkout@v4
36+
37+ # https://docs.astral.sh/uv/guides/integration/github/#setting-up-python
38+ - name : Install uv
39+ uses : astral-sh/setup-uv@v5
40+ with :
41+ enable-cache : true
42+ cache-dependency-glob : " uv.lock"
43+
44+ - name : " Set up Python"
45+ uses : actions/setup-python@v5
46+ with :
47+ python-version-file : " pyproject.toml"
48+
49+ - name : Python prep & build
50+ run : |
51+ uv sync --locked
52+
53+ uv run hatch --version
54+
55+ echo "Project version: `uv run hatch version`"
56+
57+ uv run hatch build
58+
59+ - name : Publish package distributions to PyPI
60+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 11profile :
22 pypi :
33 HATCH_INDEX_USER : ' __token__'
4- HATCH_INDEX_AUTH : ' op://private/pypi.python.org/api-token'
4+ HATCH_INDEX_AUTH : ' op://my/ private/pypi.python.org/api-token'
You can’t perform that action at this time.
0 commit comments