-
-
Notifications
You must be signed in to change notification settings - Fork 432
80 lines (66 loc) · 2.49 KB
/
releasePR.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
name: 📦 Release PR
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
on:
push:
branches:
- master
jobs:
readme:
name: Run README and save figures
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install https://github.com/DominiqueMakowski/popularipy/zipball/master
cd $GITHUB_WORKSPACE && pip install .[test]
- name: Run README_examples.py
run: |
cd $GITHUB_WORKSPACE/docs/readme
python README_examples.py
- name: Commit figures
uses: EndBug/add-and-commit@v4
with:
message: "Update README figures"
ref: "master"
add: "*.png"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
needs: readme
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install pep517
run: >-
python -m
pip install
pep517
--user
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
#if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PASSWORD }}