Skip to content

feat: update github action #5

feat: update github action

feat: update github action #5

Workflow file for this run

name: Build Release and Publish to PyPI
on:
push:
branches:
- main
jobs:
build-and-publish:
runs-on: ubuntu-latest
environment: pypi
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build pytest python-semantic-release
pip install .
- name: Run tests
run: |
pip install pytest
pytest tests/
- name: Semantic release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: semantic-release publish
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1