-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (84 loc) · 2.51 KB
/
main.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Python Package Publication
on:
workflow_dispatch:
inputs:
release-version:
required: true
dry-run:
required: true
default: true
type: boolean
linux:
type: boolean
required: true
default: true
other-os:
type: boolean
required: true
default: true
jobs:
linux-build:
if: ${{ inputs.linux }}
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Python wheels manylinux stable build
uses: RalfG/python-wheels-manylinux-build@v0.5.0
with:
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
- name: upload wheel
if: ${{ !inputs.dry-run }}
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools twine
twine upload dist/*-manylinux*.whl
continue-on-error: false
other-os-build:
if: ${{ inputs.other-os }}
runs-on: ${{ matrix.os }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: build wheel
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools twine
python setup.py bdist_wheel
- name: upload wheel
if: ${{ !inputs.dry-run }}
run: |
twine upload dist/*
continue-on-error: false
release-build:
if: ${{ !inputs.dry-run }}
needs: [ linux-build, other-os-build ]
runs-on: ubuntu-latest
steps:
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.release-version }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes