-
Notifications
You must be signed in to change notification settings - Fork 53
57 lines (49 loc) · 1.44 KB
/
build.yml
File metadata and controls
57 lines (49 loc) · 1.44 KB
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
51
52
53
54
55
56
57
name: Build package artifacts
on:
workflow_dispatch:
inputs:
python-version:
description: "The Python version to use for the build"
required: false
type: string
default: "3.10"
upload-to-release:
description: "Upload artifacts to this release"
required: false
type: boolean
default: false
release-version:
description: "Release tag to upload artifacts to"
required: false
type: string
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.release-version || github.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build sdist and wheel
run: python -m build
- name: List built artifacts
run: ls -l dist
- name: Upload workflow artifacts
uses: actions/upload-artifact@v4
with:
name: package-artifacts
path: dist/*
- name: Upload release assets
if: inputs.upload-to-release && inputs.release-version != ''
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.release-version }}
files: dist/*