Skip to content

Commit

Permalink
Add deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kbickar committed Apr 19, 2023
1 parent 9b46e7a commit 567dd6c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install build
- name: Set version number
run: |
sed -i 's/{{VERSION_PLACEHOLDER}}/'$(echo ${{ github.event.release.tag_name }} | sed 's/^v//')'/g' setup.py sense_energy/__init__.py
- name: Build package
run: python -m build -x
- name: Publish package
uses: pypa/gh-action-pypi-publish@unstable/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
async_timeout
orjson
requests
websocket-client
websockets
aiohttp
2 changes: 1 addition & 1 deletion sense_energy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
from .plug_instance import PlugInstance
from .sense_link import SenseLink

__version__ = "0.11.1"
__version__ = "{{VERSION_PLACEHOLDER}}"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with open("README.md", "r") as fh:
long_description = fh.read()

version = '0.11.1'
version = '{{VERSION_PLACEHOLDER}}'
setup(
name = 'sense_energy',
packages = ['sense_energy'],
Expand Down

0 comments on commit 567dd6c

Please sign in to comment.