-
-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (70 loc) · 1.99 KB
/
continuous_integration.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
name: Continuous integration
on:
push:
branches:
- main
- release-**
pull_request:
branches:
- '**'
release:
types: [released]
jobs:
# Run unit tests
test:
runs-on: ubuntu-20.04
strategy:
matrix:
qgis_version: [focal-3.16, focal-3.22, latest]
env:
QGIS_TEST_VERSION: ${{ matrix.qgis_version }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Test on QGIS
run: docker run -v ${GITHUB_WORKSPACE}:/usr/src -w /usr/src opengisch/qgis:${QGIS_TEST_VERSION} sh -c 'xvfb-run pytest-3'
release:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Get version number
id: v
run: |
export VERSION_NUMBER=${GITHUB_REF/refs\/tags\/v}
echo $VERSION_NUMBER > VERSION
echo "::set-output name=VERSION::${VERSION_NUMBER}"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: 🚀 Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/toppingmaker-${{ steps.v.outputs.VERSION }}-py3-none-any.whl
asset_name: dist/toppingmaker-${{ steps.v.outputs.VERSION }}-py3-none-any.whl
asset_content_type: application/binary
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}