-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.49 KB
/
build-python.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Build, Test and Publish Python
on:
workflow_call:
inputs:
shouldPublish:
description: "To publish the (Python 3.10, Ubuntu) artifact or not, default is false"
required: false
type: boolean
default: false
artifactName:
required: false
type: string
description: "Artifact name - Required when shouldPublish is true"
jobs:
build-python:
strategy:
matrix:
#os: ["ubuntu-latest", "macos-latest", "windows-latest"]
# Mac and Windows chew through build minutes - waiting until repo is public to enable
os: ["ubuntu-latest"]
python: ["3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "poetry"
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Build Wheel
run: poetry build --format wheel
- name: Upload artifact - using Python 3.10 on ubuntu-latest
if: inputs.shouldPublish == true && matrix.python == '3.10' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifactName }}
path: dist/helloworld-*-py3-none-any.whl
if-no-files-found: error