Skip to content

Commit

Permalink
p
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Vanloo committed Feb 19, 2024
1 parent 425f0fc commit 8ac08a9
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 2 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: release
run-name: Creating releases/${{ inputs.version }}

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
type: string

jobs:
create_release_branch:
name: Create release branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update version
run: |
echo -n "${{ github.event.inputs.version }}" > version.txt
sed -i 's/version = [^;]*/version = ${{ github.event.inputs.version }}/g' setup.cfg
- name: Create release branch
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -B releases/${{ github.event.inputs.version }}
git commit --allow-empty -am "Create version ${{ github.event.inputs.version }}"
git push --set-upstream origin releases/${{ github.event.inputs.version }}
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox

pypi-publish:
runs-on: ubuntu-latest
name: Upload release to PyPI
environment:
name: pypi
url: https://pypi.org/p/python-linkplay
permissions:
id-token: write
steps:
- uses: pypa/gh-action-pypi-publish@release/v1
24 changes: 24 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: test

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.11']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

[![PyPI package](https://badge.fury.io/py/python-linkplay.svg)](https://pypi.org/project/python-linkplay/)

[![Release](https://github.com/velleman/python-linkplay/actions/workflows/release/badge.svg)](https://github.com/velleman/python-linkplay/actions/workflows/release.yaml)

# python-linkplay
A Python Library for Seamless LinkPlay Device Control

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = python_linkplay
description = Python library to control LinkPlay devices
author = Velleman Group nv
version = 0.0.0
version = 0.0.1

[options]
packages = find_namespace:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from setuptools import setup


if __name__ == "__main__":
setup()
setup()
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ python =
3.11: py311, mypy, flake8

[testenv]
package = wheel
setenv =
PYTHONPATH = {toxinidir}
deps =
Expand Down

0 comments on commit 8ac08a9

Please sign in to comment.