-
-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (74 loc) · 1.93 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
85
86
87
88
name: 🧪 Tests
on:
push:
tags: "*"
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
name: "🎳 Tests"
runs-on: ubuntu-latest
strategy:
matrix:
python: [
"3.8",
"3.9",
"3.10",
]
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/[email protected]
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python requirements
run: |
python -m pip install -U pip setuptools wheel
pip install -r requirements.txt
- name: Run tests
working-directory: tests
run: |
export PYTHONPATH="${{ github.workspace }}"
python -m unittest
release:
name: "🚀 Release"
runs-on: ubuntu-20.04
needs: [tests]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Setup
run: |
VERSION=${GITHUB_REF:-0.0.0}
VERSION=${VERSION##*/}
sed -i "s/__VERSION__/${VERSION}/g" setup.py
sed -i "s/__VERSION__/${VERSION}/g" qgis_plugin_repo/__about__.py
- name: Build package
run: |
python setup.py sdist
- name: Create release on GitHub
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
artifacts: "dist/*.tar.gz"
- name: Deploy to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}