forked from quantopian/pyfolio
-
Notifications
You must be signed in to change notification settings - Fork 116
72 lines (62 loc) · 1.71 KB
/
build_wheels.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
name: PyPI
on:
workflow_dispatch:
inputs:
target:
type: choice
description: 'Package Index'
required: true
default: 'PYPI'
options: [ 'TESTPYPI', 'PYPI' ]
version:
type: string
description: 'Version tag'
required: true
default: '0.9.8'
jobs:
dist:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10" ]
steps:
- name: Checkout pyfolio
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build wheels
run: pipx run build
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
path: dist/*
- name: Check metadata
run: pipx run twine check dist/*
upload_pypi:
needs: [ dist ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: publish to testpypi
if: ${{ github.event.inputs.target == 'TESTPYPI' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TESTPYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: publish to pypi
if: ${{ github.event.inputs.target == 'PYPI' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}