-
Notifications
You must be signed in to change notification settings - Fork 19
57 lines (49 loc) · 2.04 KB
/
release.yaml
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
name: Geoscan Python Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
# The first step is obviously to check out the repository
- name: Checkout project
uses: actions/checkout@v2
# We test and package our code against python 3.9 distribution
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.9"
# we create our own pip cache where dependencies from requirements.txt will be stored
- name: Configure Python
uses: actions/cache@v2
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
${{ runner.os }}-pip-
# Let's install pip and make sure we run against latest version
- name: Install pip
run: python -m pip install --upgrade pip
# And install any dependency required for unit testing
- name: Install dependencies
working-directory: ./python
run: pip install -U -r requirements.txt wheel semver
# Here comes the crux of our python development. See core logic in our setup.py file
# Given a successful maven release, we get the latest tag to date, compute the version
# and package our python code against. This ensures that python package X.Y.Z was packaged to
# work against scala dependency X.Y.Z. Whilst the former will be available on pypi, the latter is
# available on github packages
- name: Build python dist
working-directory: ./python
run: python setup.py clean bdist_wheel
# with our packaged application, we simply deploy to pypi repo provided our token stored as secret
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.LABS_PYPI_TOKEN }}
packages_dir: python/dist/