mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 11:06:56 +08:00
Package: support either 'build' or 'setuptools'
This commit is contained in:
35
.github/workflows/Package.yml
vendored
35
.github/workflows/Package.yml
vendored
@@ -33,7 +33,7 @@ on:
|
|||||||
requirements:
|
requirements:
|
||||||
description: 'Python dependencies to be installed through pip.'
|
description: 'Python dependencies to be installed through pip.'
|
||||||
required: false
|
required: false
|
||||||
default: 'wheel'
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
artifact:
|
artifact:
|
||||||
description: 'Name of the package artifact.'
|
description: 'Name of the package artifact.'
|
||||||
@@ -55,17 +55,38 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python_version }}
|
python-version: ${{ inputs.python_version }}
|
||||||
|
|
||||||
- name: 🔧 Install dependencies for packaging and release
|
- name: 🐍 Update pip
|
||||||
run: |
|
run: python -m pip install -U pip
|
||||||
python -m pip install -U pip
|
|
||||||
python -m pip install ${{ inputs.requirements }}
|
|
||||||
|
|
||||||
- name: 🔨 Build Python package (source distribution)
|
# build
|
||||||
|
|
||||||
|
- name: 🔧 [build] Install dependencies for packaging and release
|
||||||
|
if: inputs.requirements == ''
|
||||||
|
run: python -m pip install build
|
||||||
|
|
||||||
|
- name: 🔨 [build] Build Python package (source distribution)
|
||||||
|
if: inputs.requirements == ''
|
||||||
|
run: python -m build --sdist
|
||||||
|
|
||||||
|
- name: 🔨 [build] Build Python package (binary distribution - wheel)
|
||||||
|
if: inputs.requirements == ''
|
||||||
|
run: python -m build --wheel
|
||||||
|
|
||||||
|
# setuptools
|
||||||
|
|
||||||
|
- name: 🔧 [setuptools] Install dependencies for packaging and release
|
||||||
|
if: inputs.requirements != ''
|
||||||
|
run: python -m pip install ${{ inputs.requirements }}
|
||||||
|
|
||||||
|
- name: 🔨 [setuptools] Build Python package (source distribution)
|
||||||
|
if: inputs.requirements != ''
|
||||||
run: python setup.py sdist
|
run: python setup.py sdist
|
||||||
|
|
||||||
- name: 🔨 Build Python package (binary distribution - wheel)
|
- name: 🔨 [setuptools] Build Python package (binary distribution - wheel)
|
||||||
|
if: inputs.requirements != ''
|
||||||
run: python setup.py bdist_wheel
|
run: python setup.py bdist_wheel
|
||||||
|
|
||||||
|
|
||||||
- name: 📤 Upload wheel artifact
|
- name: 📤 Upload wheel artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user