Skip to content

dev & chlog: new section #667

dev & chlog: new section

dev & chlog: new section #667

Workflow file for this run

name: PyPI Release
# https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
paths:
- ".github/workflows/publish-pkg.yml"
release:
types: [published]
jobs:
# based on https://github.com/pypa/gh-action-pypi-publish
build-package:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: >-
python -m pip install --user --upgrade setuptools wheel
- name: Build packages
run: |
python setup.py sdist bdist_wheel
ls -lh dist/
- uses: actions/upload-artifact@v4
with:
name: pypi-packages-${{ github.sha }}
path: dist
release-upload:
needs: build-package
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/download-artifact@v4
with:
name: pypi-packages-${{ github.sha }}
path: dist
- run: ls -lh dist/
- name: Upload to release
uses: AButler/[email protected]
with:
files: "dist/*"
repo-token: ${{ secrets.GITHUB_TOKEN }}
publish-pypi-test:
needs: build-package
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/download-artifact@v4
with:
name: pypi-packages-${{ github.sha }}
path: dist
- run: ls -lh dist/
# We do this, since failures on test.pypi aren't that bad
- name: Publish to Test PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
verbose: true
publish-delayed:
needs: publish-pypi-test
runs-on: ubuntu-latest
steps:
- uses: juliangruber/sleep-action@v2
with:
time: 5m
publish-pypi-main:
needs: [build-package, publish-delayed]
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/download-artifact@v4
with:
name: pypi-packages-${{ github.sha }}
path: dist
- run: ls -lh dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
verbose: true