forked from fdobad/template-python-package
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.04 KB
/
publish-pypi.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
name: publishing on pypi
on:
push:
branches:
- publish
tags:
- 'v*'
workflow_dispatch:
jobs:
qgis-job:
runs-on: ubuntu-latest
container: qgis/qgis:latest
steps:
- name: Inspect container
run: |
qgis --version
python3 -V
echo $SHELL
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
python3 -m venv .venv --system-site-packages
source .venv/bin/activate
python -m pip install --upgrade pip wheel setuptools setuptools_scm build twine
pip install -r requirements.txt
shell: bash
- name: Build package
run: |
source .venv/bin/activate
python -m build
shell: bash
- name: Publish package to PyPI
if: startsWith(github.ref, 'refs/tags/v')
run: |
source .venv/bin/activate
twine upload dist/*
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
shell: bash