Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #36 from And3rsL/publish
Browse files Browse the repository at this point in the history
Use action to publish new version
  • Loading branch information
edenhaus authored Jun 16, 2021
2 parents 9621928 + 86619f1 commit f6baff0
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#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]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v2

- name: 🔢 Get release version
id: version
uses: home-assistant/actions/helpers/version@master

- name: 🖊️ Set version number
run: |
sed -i '/version=/c\ version="${{ steps.version.outputs.version }}",' "${{ github.workspace }}/setup.py"
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: 📦 Build package
run: python -m build

- name: 📤 Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from codecs import open
from os import path

from setuptools import setup, find_packages
Expand All @@ -10,7 +9,7 @@

setup(
name="deebotozmo",
version="1.8.0",
version="0.0.0",
description="a library for controlling certain robot vacuums",
long_description=long_description,
# Author details
Expand Down

0 comments on commit f6baff0

Please sign in to comment.