-
Notifications
You must be signed in to change notification settings - Fork 60
41 lines (32 loc) · 1.14 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
name: Build distribution
on: [push, pull_request]
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Python setup
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Check style
run: python -m pip install flake8 && flake8 bluetti_mqtt
- name: Install build dependencies
run: python -m pip install build
- name: Build distributions
run: python -m build
- name: Publish to Test PyPI
if: github.repository == 'warhammerkid/bluetti_mqtt'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
skip_existing: true
repository_url: https://test.pypi.org/legacy/
- name: Publish tagged to PyPI
if: github.repository == 'warhammerkid/bluetti_mqtt' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}