-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
# .github/workflows/ci-cd.yml | ||
|
||
name: Publish ${package_name} to PyPI / GitHub | ||
name: Publish to PyPI | ||
|
||
on: | ||
workflow_dispatch: # Manual trigger | ||
push: | ||
tags: | ||
- "v*" | ||
workflow_dispatch: | ||
- 'v*' # Trigger on any tag push | ||
|
||
jobs: | ||
pypi-publish: | ||
name: Upload release to PyPI | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/pykanto | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
steps: | ||
# retrieve your distributions here | ||
|
||
- name: Publish package distributions to PyPI | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all history and tags | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build wheel | ||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |