Skip to content

Commit

Permalink
Add building steps
Browse files Browse the repository at this point in the history
  • Loading branch information
nilomr committed Nov 12, 2024
1 parent e4d9193 commit d4b9956
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions .github/workflows/ci-cd.yml
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

0 comments on commit d4b9956

Please sign in to comment.