forked from moustic999/bosch-thermostat-http-client-python
-
Notifications
You must be signed in to change notification settings - Fork 21
41 lines (39 loc) · 1.11 KB
/
publish-to-pypi.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
name: Publish Bosch Thermostat Client 🐍 distributions 📦 to PyPI
on:
push:
tags:
- v*
branches:
- 'dev'
paths:
- '**.py'
pull_request:
branches: [dev]
release:
types: # This configuration does not affect the page_build event above
- created
- edited
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: pdm-project/setup-pdm@v3
name: Setup Python and PDM
with:
python-version: "3.10"
architecture: x64
# version: 1.15.3
enable-pep582: true # Enable PEP 582 package loading globally
- name: Install dependencies
run: |
python -m pip install -U twine
- name: Build
run: |
pdm build
- name: Publish package
if: startsWith(github.ref, 'refs/tags') || startsWith(github.event.inputs.tags, 'Deploy')
run: |
pdm plugin add pdm-publish
pdm publish --password ${{ secrets.PYPI_API_TOKEN }}