add reusable workflows

This commit is contained in:
umarcor
2021-11-22 02:07:12 +01:00
parent 7647c96c79
commit 35738eef8f
11 changed files with 633 additions and 0 deletions

48
.github/workflows/Package.yml vendored Normal file
View 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