This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
generated from volpatto/blank-python-project
-
Notifications
You must be signed in to change notification settings - Fork 5
93 lines (80 loc) · 2.49 KB
/
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
name: publish
on:
push:
branches: [ master ]
tags: [ "*" ]
paths-ignore:
- '.github/**'
pull_request:
branches: [ master ]
jobs:
build-wheels-and-publish:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
architecture: [ x64 ]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Installing pip packages
run: |
pip install wheel
pip install twine
- uses: Gr1N/setup-poetry@v8
with:
poetry-version: "1.2.2"
- name: Install dependencies
run: |
poetry install
- name: Testing (native blst tests)
run: |
python setup.py build_ext --inplace
python ./lido_sdk/blstverify/test.py
- name: Testing (pytest)
env:
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
run: |
poetry run pytest .
- name: Building binary wheel distribution (windows and macos)
if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
run: |
python setup.py bdist_wheel --universal
- name: Building source distrubution (linux only)
if: matrix.os == 'ubuntu-latest'
run: |
python setup.py sdist
- name: Upload binary distrubutions as artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: ./dist
if-no-files-found: error
- name: Publish distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload --non-interactive --skip-existing --verbose 'dist/*'
- name: Publish distribution to Test PyPI
continue-on-error: true
env:
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
twine upload --non-interactive --skip-existing --verbose 'dist/*'