Skip to content

Commit

Permalink
Enablei Github release as pypi CD trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperDramsch committed Jul 30, 2024
1 parent 343d6fb commit b0836bb
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/cd-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
---
name: cd-pypi

on:
workflow_call:

jobs:
deploy:
if: ${{ github.ref_type == 'tag' }}
if: ${{ github.ref_type == 'tag' || github.event_name == 'release' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
- name: Check version
run: |
if [ -f "setup.py" ]; then
release=${{ github.ref_name }}
version=$(python setup.py --version)
test "$release" == "$version"
fi
- name: Check version
run: |
if [ -f "setup.py" ]; then
release=${{ github.ref_name }}
version=$(python setup.py --version)
test "$release" == "$version"
fi
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload dist/*
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
twine upload dist/*

0 comments on commit b0836bb

Please sign in to comment.