mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: Package
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
python_version:
|
|
description: 'Python version.'
|
|
required: false
|
|
default: '3.10'
|
|
type: string
|
|
requirements:
|
|
description: 'Python dependencies to be installed through pip.'
|
|
required: false
|
|
default: 'wheel'
|
|
type: string
|
|
artifact:
|
|
description: 'Name of the package artifact.'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
|
|
Package:
|
|
name: 📦 Package in Source and Wheel Format
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: ⏬ Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: 🐍 Setup Python ${{ inputs.python_version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ inputs.python_version }}
|
|
|
|
- name: 🔧 Install dependencies for packaging and release
|
|
run: |
|
|
python -m pip install -U pip
|
|
python -m pip install ${{ inputs.requirements }}
|
|
|
|
- name: 🔨 Build Python package (source distribution)
|
|
run: python setup.py sdist
|
|
|
|
- name: 🔨 Build Python package (binary distribution - wheel)
|
|
run: python setup.py bdist_wheel
|
|
|
|
- name: 📤 Upload wheel artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ inputs.artifact }}
|
|
path: dist/
|
|
if-no-files-found: error
|
|
retention-days: 1
|