-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
github_actions_template.yml
98 lines (82 loc) · 2.93 KB
/
github_actions_template.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
# Example template to automatically build and upload binary artifacts to PyPi
# when releases are created on GitHub. Supports Windows, MacOS, and Linux.
# Place into your Project/.github/workflows to use it.
# For the PYPI_USERNAME and PYPI_PASSWORD environment variables, create them
# using your GitHub repo's Settings/Secrets page.
name: CI
on:
release:
types: [created]
jobs:
# ----------------------------------------------------------------------------
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: jiro4989/setup-nim-action@v1.0.2
with:
nim-version: '1.0.6'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine nimporter
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
WHEEL=dist/$(python3 -c 'import pathlib;print([*pathlib.Path("dist").glob("pebaz*")][0].name.replace("linux", "manylinux1"))')
mv dist/$(python -c "import pathlib;print([*pathlib.Path('dist').glob('pebaz*')][0].name)") $WHEEL
ls dist
twine upload dist/*
# ----------------------------------------------------------------------------
build-win32:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: jiro4989/setup-nim-action@v1.0.2
with:
nim-version: '1.0.6'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine nimporter
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
twine upload dist/*
# ----------------------------------------------------------------------------
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: jiro4989/setup-nim-action@v1.0.2
with:
nim-version: '1.0.6'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install setuptools wheel twine nimporter
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python3 setup.py bdist_wheel
twine upload dist/*