Skip to content

Commit 73b1c47

Browse files
LouisBrunnerCharlesworth
authored andcommitted
Add auto publish
1 parent 0721e2e commit 73b1c47

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 on release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Set up Python
14+
uses: actions/setup-python@v1
15+
with:
16+
python-version: '3.x'
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install setuptools wheel
21+
- name: Build
22+
env:
23+
VERSION_RAW: ${{ github.ref }}
24+
# Transform refs/tags/v0.0.2a01 to 0.0.2a01 and inject it into setup.py
25+
run: |
26+
export VERSION=`echo $VERSION_RAW | sed -E 's;.*/v(.*)$;\1;'`
27+
sed -i 's/%VERSION%/'$VERSION'/' setup.py
28+
python setup.py sdist bdist_wheel
29+
- name: Publish a Python distribution to PyPI
30+
uses: pypa/gh-action-pypi-publish@master
31+
with:
32+
user: __token__
33+
password: ${{ secrets.PYPI_TOKEN }}

setup.py

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

66
setuptools.setup(
77
name='evasdk',
8-
version='0.0.1',
8+
version='%VERSION%',
99
description='SDK for the Automata Eva robotic arm',
1010
author='Automata',
1111
license='Apache License 2.0',

0 commit comments

Comments
 (0)