build sdist and pure wheel in the same wheels.yml workflow
.zip is deprecated for Python source distributions so use the default .tar.gz
This commit is contained in:
parent
82e368e2b7
commit
d264510618
34
.github/workflows/publish.yml
vendored
34
.github/workflows/publish.yml
vendored
@ -1,34 +0,0 @@
|
||||
# This workflows will upload a Python Package using Twine when a tag is created
|
||||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- '*.*.*' # e.g. 1.0.0 or 20.15.10
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install setuptools wheel twine
|
||||
- name: Build and publish
|
||||
env:
|
||||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
twine upload dist/*
|
35
.github/workflows/wheels.yml
vendored
35
.github/workflows/wheels.yml
vendored
@ -3,9 +3,6 @@ name: Build + Deploy
|
||||
on:
|
||||
push:
|
||||
tags: ["*.*.*"]
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
# enables workflow to be run manually
|
||||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
|
||||
workflow_dispatch:
|
||||
@ -21,6 +18,26 @@ env:
|
||||
|
||||
jobs:
|
||||
|
||||
build_pure:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install setuptools wheel twine
|
||||
- name: Build source distribution and pure-python wheel
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
path: |
|
||||
dist/*.whl
|
||||
dist/*.tar.gz
|
||||
|
||||
build_wheels:
|
||||
name: ${{ matrix.type }} ${{ matrix.arch }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
@ -86,17 +103,19 @@ jobs:
|
||||
path: wheelhouse/*.whl
|
||||
|
||||
deploy:
|
||||
name: Upload if release
|
||||
needs: [build_wheels, build_arch_wheels]
|
||||
name: Upload to PyPI on tagged commit
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'release' && github.event.action == 'published'
|
||||
|
||||
needs:
|
||||
- build_pure
|
||||
- build_wheels
|
||||
- build_arch_wheels
|
||||
# only run if the commit is tagged...
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: artifact
|
||||
path: dist
|
||||
|
||||
- uses: pypa/gh-action-pypi-publish@v1.8.6
|
||||
with:
|
||||
user: __token__
|
||||
|
Loading…
x
Reference in New Issue
Block a user