Skip to content

Commit bc60e32

Browse files
authored
Merge pull request #68 from lostfields/chore/package-version
Use release tag as package version
2 parents a8382d3 + b258710 commit bc60e32

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.github/workflows/python-publish.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,25 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21+
- id: setup
22+
name: setup
23+
run:
24+
echo "::set-output name=version::$( echo $GITHUB_REF_NAME | sed 's/v\?\(.*\)/\1/g' )"
25+
2126
- uses: actions/checkout@master
27+
2228
- name: Set up Python 3.7
2329
uses: actions/setup-python@v1
2430
with:
2531
python-version: 3.7
32+
2633
- name: Install pypa/build
2734
run: >-
2835
python -m
2936
pip install
3037
build
3138
--user
39+
3240
- name: Build a binary wheel and a source tarball
3341
run: >-
3442
python -m
@@ -37,6 +45,16 @@ jobs:
3745
--wheel
3846
--outdir dist/
3947
.
48+
env:
49+
VERSION: ${{ steps.setup.outputs.version }}
50+
51+
- name: upload artifact
52+
uses: actions/upload-artifact@v2
53+
with:
54+
name: artifact
55+
path: dist
56+
retention-days: 7
57+
4058
- name: Publish distribution to PyPI
4159
uses: pypa/gh-action-pypi-publish@master
4260
with:

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
""" Setup for python-panasonic-comfort-cloud """
22

33
from setuptools import setup
4+
import os
45

56
with open("README.md", "r") as fh:
67
long_description = fh.read()
78

89
setup(
910
name='pcomfortcloud',
10-
version='0.0.22',
11+
version=os.getenv('VERSION', default='0.0.1'),
1112
description='Read and change status of Panasonic Comfort Cloud devices',
1213
long_description=long_description,
1314
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)