mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
add reusable workflows
This commit is contained in:
48
.github/workflows/Package.yml
vendored
Normal file
48
.github/workflows/Package.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Package
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
pyver:
|
||||
description: 'Python version.'
|
||||
required: false
|
||||
default: '3.10'
|
||||
type: string
|
||||
artifact:
|
||||
description: 'Name of the wheel artifact.'
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
|
||||
Package:
|
||||
name: 📦 Package in Wheel Format
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: 🐍 Setup Python ${{ inputs.pyver }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ inputs.pyver }}
|
||||
|
||||
- name: 🔧 Install dependencies for packaging and release
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install wheel
|
||||
|
||||
- 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
|
||||
Reference in New Issue
Block a user