Skip to content

Commit

Permalink
Merge pull request #48 from pabl-o-ce/master
Browse files Browse the repository at this point in the history
Enhance CI workflow to include package publishing to PyPI
  • Loading branch information
Maximilian-Winter authored May 7, 2024
2 parents 229c23f + 1073f7a commit 5335280
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 41 deletions.
34 changes: 32 additions & 2 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Python-CI

on: [push]
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
release:
types: [published]

jobs:
build:
Expand All @@ -14,9 +20,33 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and Build package
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
publish:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@3fbcf7ccf443305955ce16db9de8401f7dc1c7dd
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
39 changes: 0 additions & 39 deletions .github/workflows/python-publish.yml

This file was deleted.

0 comments on commit 5335280

Please sign in to comment.