-
Notifications
You must be signed in to change notification settings - Fork 31
84 lines (60 loc) · 1.61 KB
/
release.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
# Github Action definition for publishing to PyPI when a release is
# tagged.
name: PyPI
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version:
- '2.7'
- '3.9'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
if: ${{ matrix.python-version != '2.7' }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
if: ${{ matrix.python-version == '2.7' }}
run: |
sudo apt-get install -y python2
- name: Install system packages
run: |
sudo apt-get install -y libssl-dev openssl swig
- name: Install python dependencies
run: |
pip install wheel
- name: Build source distribution
if: ${{ matrix.python-version != '2.7' }}
run: |
python setup.py sdist --output dist
- name: Build binary wheel distribution
run: |
python setup.py bdist_wheel --output dist
- name: Save content
uses: actions/upload-artifact@v3
with:
path: dist/
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs:
- build
environment:
name: pypi
url: https://pypi.org/p/javatools
steps:
- name: Fetch content
uses: actions/download-artifact@v4.1.7
with:
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# The end.