Skip to content

Merge pull request #17 from mindfiredigital/master #1

Merge pull request #17 from mindfiredigital/master

Merge pull request #17 from mindfiredigital/master #1

name: Release and Publish Package
on:
push:
branches:
- main
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine semantic-release setuptools-scm
- name: Run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name github-actions
git config user.email github-actions@github-actions.github.com
semantic-release version
semantic-release publish
- name: Build package
run: python -m build
- name: Publish package to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
- name: Delete release-main branch from remote
run: git push origin --delete release-main