Skip to content

Commit

Permalink
Merge pull request #100 from felix-seifert/release-on-pypi
Browse files Browse the repository at this point in the history
ci: add workflow to automatically release to PyPI and GitHub
  • Loading branch information
csgoh authored Mar 18, 2024
2 parents c8ce980 + 787df9b commit db4205c
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Release to PyPI and GitHub

on:
push:
tags:
- 'v*' # Push events with tags 'v*', i.e. 'v1.0.4' or 'v0.3.2'

jobs:
deploy-with-twine:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
src
pyproject.toml
requirements.txt
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.10
cache: "pip"

- name: Install dependencies (with Twine)
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install twine
- name: Build dist
run: |
python -m build
- name: Test dist
run: |
python -m twine check dist/*
- name: Deploy dist
run: |
python -m twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

release-on-github:
needs: deploy-with-twine
name: Trigger GitHub release workflow
uses: ./.github/workflows/release-on-github.yaml
with:
tag: ${{ github.ref_name }}

0 comments on commit db4205c

Please sign in to comment.