-
-
Notifications
You must be signed in to change notification settings - Fork 2
116 lines (92 loc) · 2.44 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: 🧪 Tests
on:
push:
tags: "*"
branches:
- master
pull_request:
branches:
- master
jobs:
tests:
name: "🎳 Tests"
runs-on: ubuntu-latest
strategy:
matrix:
python: [
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
]
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Upgrade PIP
run: pip install --upgrade pip
- name: Run tests
working-directory: test
run: |
export PYTHONPATH="${{ github.workspace }}"
python -m unittest
ruff:
name: "❄ Ruff"
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Upgrade PIP
run: pip install --upgrade pip
- name: Checkout
uses: actions/checkout@v4
- name: Install Python requirements
run: pip install -r requirements-dev.txt
- name: Run Ruff
run: make lint
release:
name: "🚀 Release"
runs-on: ubuntu-20.04
needs: [tests, ruff]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- 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: Upgrade PIP
run: pip install --upgrade pip
- 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_manager/__about__.py
- name: Read the changelog
id: changelog
uses: 3liz/[email protected]
- name: Build package
run: |
python setup.py sdist
- name: Create release on GitHub
uses: ncipollo/[email protected]
with:
body: ${{ steps.changelog.outputs.markdown }}
token: ${{ secrets.BOT_HUB_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 }}