Skip to content

Commit

Permalink
Add semantic realese workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Sep 13, 2020
1 parent 410c41a commit 0af2467
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 4 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/semantic_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: semantic_release

on:
push:
branches:
- master

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
with:
ref: master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install python-semantic-release
- name: Setup Git
run: |
git config --global user.name "semantic-release"
git config --global user.email "semantic-release@GitHub"
- name: Publish with semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
DEBUG='*' semantic-release publish
# Pack the ha-average dir as a zip and upload to the release
- name: Zip average dir
run: |
cd /home/runner/work/ha-average/ha-average/custom_components/average
zip average.zip -r ./
- name: Set release variable
run: |
echo "::set-env name=release_version::`git describe --abbrev=0`"
- name: Sleep
# add delay so upload does not kill the release notes from semantic-release
run: |
sleep 5
- name: Upload zip to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/ha-average/ha-average/custom_components/average/average.zip
asset_name: average.zip
tag: ${{ env.release_version }}
overwrite: true
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ repos:
- id: no-commit-to-branch
args:
- --branch=master
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.23.0
hooks:
- id: yamllint
- repo: local
hooks:
# Run mypy through our wrapper script in order to get the possible
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ exclude =

[mypy]
ignore_missing_imports = True

[semantic_release]
version_variable=custom_components/average/__init__.py:VERSION
upload_to_pypi=false
upload_to_release=false

0 comments on commit 0af2467

Please sign in to comment.