-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (86 loc) · 2.69 KB
/
python-publish.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
90
91
92
93
94
95
96
97
98
99
100
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: read
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build sdist
run: |
pip install build
python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_wheels_windows:
name: Build wheel on windows-latest/${{matrix.arch}}/${{matrix.python_tag}}
needs: [build_sdist]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
arch: [auto32, auto64, ARM64]
python_tag: ["cp38-*", "cp39-*", "cp310-*", "cp311-*", "cp312-*", "pp38-*", "pp39-*"]
exclude:
# PyPy only supports x86_64 on Windows
- arch: auto32
python_tag: "pp38-*"
- arch: auto32
python_tag: "pp39-*"
# ARM64 only supported only supported on cpython >= 3.9
- arch: ARM64
python_tag: "pp38-*"
- arch: ARM64
python_tag: "pp39-*"
- arch: ARM64
python_tag: "cp38-*"
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: actions/setup-python@v4
- name: Copy wheel
run: cp dist/*.tar.gz multi_bible_search.tar.gz
- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: multi_bible_search.tar.gz
output-dir: wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
deploy:
needs: [build_wheels_windows, build_sdist]
name: deploy wheels to pypi
runs-on: ubuntu-latest
environment: pypi-release
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}