Skip to content

Commit

Permalink
feat: add github actions to auto-update
Browse files Browse the repository at this point in the history
  • Loading branch information
ehdgua01 committed Aug 10, 2020
1 parent 7aec156 commit 1d417ce
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
push:
branches:
- master

jobs:
beautify:
runs-on: ubuntu-latest

steps:
- name: Set up pre-commit repo cache
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- uses: pre-commit/action@v2.0.0

release:
runs-on: ubuntu-latest
needs: [beautify]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Python Semantic Release
uses: relekang/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions hooks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def main() -> int:
and args.output not in args.filenames
and args.without_output is False
):
print(f"{args.output} not staged for commit")
print(f"{args.output} do not stage")
return FAIL

return PASS
Expand Down
Empty file.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ line-length = 80

[tool.isort]
line_length = 80

[tool.semantic_release]
version_variable = "hooks/__init__.py:__version__"
upload_to_pypi = false
upload_to_release = false
commit_parser = "semantic_release.history.angular_parser"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ python_requires = >=3.6.1

[options.entry_points]
console_scripts =
poetry-export-requirements = poetry_export_requirements.poetry_export_requirements:main
poetry-export-requirements = hooks.poetry_export_requirements:main

0 comments on commit 1d417ce

Please sign in to comment.