.github/workflows/workflow.yaml #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
schedule: | |
- cron: '0 3 * * 6' | |
jobs: | |
check: | |
name: "Check" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.x" | |
- name: 'Install Dependencies' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pipenv | |
pipenv install --system --dev | |
python -m pip install . | |
- name: 'Check Formatting (flake8)' | |
run: flake8 . | |
- name: 'Check Formatting (black)' | |
run: black --check . | |
- name: 'Check Docs' | |
run: ./bin/check_docs_updated.sh | |
build: | |
name: "Build and Test" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9, 3.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: 'Install Dependencies' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pipenv wheel | |
pipenv install --system --dev | |
python -m pip install . | |
- name: 'Run Tests' | |
run: | | |
python setup.py test | |
- name: "Build" | |
run: | | |
sed -i "s/0.0.0-dev/$(git describe --tags --exact-match)/" appdaemon_testing/__init__.py | |
python setup.py sdist bdist_wheel | |
- uses: actions/upload-artifact@v2 | |
# Only publish artifacts from Python latest build. | |
if: ${{ matrix.python-version == '3.x' }} | |
with: | |
name: dist | |
path: dist/ | |
if-no-files-found: error | |
release: | |
name: "Release 🚀" | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- check | |
if: startsWith(github.ref, 'refs/tags') | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: dist | |
path: dist/ | |
- name: Release to PyPi 📦 | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- name: Create Github Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
generate_release_notes: true | |
files: dist/* |