Skip to content

Commit 2d34846

Browse files
authored
Merge pull request #69 from JonGilmore/automateReleases
chore(ci): automate releases with tags
2 parents b546f95 + e956226 commit 2d34846

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Python 🐍 distributions 📦 to PyPI
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Get tagged version
11+
id: vars
12+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
13+
- name: Replace tag template in `setup.py`
14+
env:
15+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
16+
run: |
17+
echo replacing TEMPLATE_VERSION in setup.py with $RELEASE_VERSION...
18+
sed -i "s|TEMPLATE_VERSION|$RELEASE_VERSION|" setup.py
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: "3.x"
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel twine
27+
- name: Build and publish
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
31+
run: |
32+
python setup.py sdist bdist_wheel
33+
python -m twine upload dist/*

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
setup(
66
name = 'pylutron',
7-
version = '0.2.8',
7+
version = 'TEMPLATE_VERSION',
88
license = 'MIT',
99
description = 'Python library for Lutron RadioRA 2',
1010
author = 'Dima Zavin',

0 commit comments

Comments
 (0)