-
Notifications
You must be signed in to change notification settings - Fork 94
64 lines (56 loc) · 1.73 KB
/
python-publish.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
###########################################################################
# ELM327-emulator
# ELM327 Emulator for testing software interfacing OBDII via ELM327 adapter
# https://github.com/Ircama/ELM327-emulator
# (C) Ircama 2021 - CC-BY-NC-SA-4.0
###########################################################################
name: Upload ELM327-emulator Package to PyPI and TestPyPI
#on:
# release:
# types: [created]
#on: [push]
on:
push:
tags:
- 'v*'
jobs:
build-n-publish:
name: Build and publish Python to PyPI and TestPyPI
runs-on: ubuntu-latest
# Checking out the project and building distributions
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
# This will download your repository into the CI runner and then install and activate Python
- name: Install upgrade pip
run: >-
python -m
pip install
--upgrade pip
- name: Install dependencies
run: >-
python -m
pip install pyyaml python-daemon obd setuptools wheel twine
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python setup.py sdist bdist_wheel
# This will create the /dist directory including the package build.
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --repository pypi dist/*
twine upload --repository testpypi dist/*
# This will publish the /dist directory.