Skip to content

Commit

Permalink
Reuse GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba2k2 committed Aug 28, 2023
1 parent f59e6a9 commit 1762e8b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 79 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/publish.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .github/workflows/push-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Push (dev), Pull Request
on:
push:
tags-ignore: ["v*.*.*"]
pull_request:
jobs:
lint-python:
name: Run Python lint
uses: kuba2k2/kuba2k2/.github/workflows/lint-python.yml@master
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
name: Deploy website to GitHub Pages

name: Push (master)
on:
workflow_dispatch:
push:
branches:
- master

permissions:
contents: write

branches: ["master"]
jobs:
deploy:
name: Deploy website to GitHub Pages
deploy-pages:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python 3.10
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand All @@ -28,12 +23,8 @@ jobs:
poetry build
cp dist/*.whl web/
mv web/*.whl web/upk2esphome.whl
mv web/*.whl web/upk2esphome-0.1.0-py3-none-any.whl
# - name: Publish to PyPI
# run: poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
- name: Deploy API to GitHub Pages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: web/
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release
on:
push:
tags: ["v*.*.*"]
jobs:
lint-python:
name: Run Python lint
uses: kuba2k2/kuba2k2/.github/workflows/lint-python.yml@master
publish-pypi:
name: Publish PyPI package
needs:
- lint-python
uses: kuba2k2/kuba2k2/.github/workflows/publish-pypi.yml@master
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
2 changes: 1 addition & 1 deletion web/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages": [
"./upk2esphome-0.1.0-py3-none-any.whl"
"./upk2esphome.whl"
]
}

0 comments on commit 1762e8b

Please sign in to comment.