diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml
index a76497d..9544906 100644
--- a/.github/workflows/python-publish.yml
+++ b/.github/workflows/python-publish.yml
@@ -1,34 +1,42 @@
-# This workflow will upload a Python Package using Twine when a release is created
-
name: pypi-publish
-# Controls when the workflow will run
on:
- workflow_dispatch: {}
release:
- types: [ published ]
+ types:
+ - published
+ push:
+ branches:
+ - main
+ paths:
+ - '**/*.py'
+ - 'pyproject.toml'
+ workflow_dispatch:
+ inputs:
+ dry_run:
+ type: choice
+ description: Dry run mode
+ required: true
+ options:
+ - "true"
+ - "false"
jobs:
- deploy:
-
- runs-on: ubuntu-latest
-
+ pypi-publisher:
+ runs-on: thevickypedia-lite
steps:
- - uses: actions/checkout@v2
- - 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 twine
- - name: Create packages
- run: python -m build
- - name: Run twine check
- run: twine check dist/*
- - name: Upload to pypi
- env:
- TWINE_USERNAME: ${{ secrets.PYPI_USER }}
- TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- run: twine upload dist/*.whl
+ - name: Set dry-run
+ run: |
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ echo "::notice title=DryRun::Setting dry run to ${{ inputs.dry_run }} for '${{ github.event_name }}' event"
+ echo "dry_run=${{ inputs.dry_run }}" >> $GITHUB_ENV
+ elif [[ "${{ github.event_name }}" == "push" ]]; then
+ echo "::notice title=DryRun::Setting dry run to true for '${{ github.event_name }}' event"
+ echo "dry_run=true" >> $GITHUB_ENV
+ else
+ echo "::notice title=DryRun::Setting dry run to false for '${{ github.event_name }}' event"
+ echo "dry_run=false" >> $GITHUB_ENV
+ fi
+ - uses: thevickypedia/pypi-publisher@v3
+ with:
+ token: ${{ secrets.PYPI_TOKEN }}
+ dry-run: ${{ env.dry_run }}
diff --git a/.gitignore b/.gitignore
index 6f3ee1f..94a6672 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+__pycache__/
.env
.idea
venv
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 5eb7882..c520f85 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,3 +1,4 @@
+fail_fast: true
repos:
-
repo: https://github.com/PyCQA/flake8
diff --git a/docs/genindex.html b/docs/genindex.html
index 3a3a770..6be1c27 100644
--- a/docs/genindex.html
+++ b/docs/genindex.html
@@ -47,6 +47,7 @@
Index
| G
| L
| M
+ | N
| P
| S
| W
@@ -55,10 +56,12 @@ Index
C
+N
+
+
P
diff --git a/docs/index.html b/docs/index.html
index 85c6fd0..2f6fe25 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -220,6 +220,30 @@ Welcome to PyWiFi Controls’s documentation! |