Skip to content

Commit

Permalink
feat/packaging workflows (#32)
Browse files Browse the repository at this point in the history
Co-authored-by: jarbasai <jarbasai@mailfence.com>
  • Loading branch information
JarbasAl and JarbasAl committed Feb 25, 2022
1 parent ccaae37 commit 9e3c202
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 12 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ on:
pull_request:
branches:
- dev
paths-ignore:
- 'ovos_utils/version.py'
- 'test/**'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'readme.md'
- 'scripts/**'
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
- dev
paths-ignore:
- 'ovos_utils/version.py'
- 'setup.py'
- 'test/**'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/publish_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Increment Version
- name: Remove alpha (declare stable)
run: |
VER=$(python setup.py --version)
python scripts/bump_build.py
python scripts/remove_alpha.py
- name: "Generate release changelog"
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Commit to dev
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Increment Version
commit_message: Declare alpha stable
branch: dev
- name: Push dev -> master
uses: ad-m/github-push-action@master
Expand All @@ -58,6 +58,18 @@ jobs:
- name: Build Distribution Packages
run: |
python setup.py bdist_wheel
- name: Prepare next Build version
run: echo "::set-output name=version::$(python setup.py --version)"
id: alpha
- name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0
run: |
VER=$(python setup.py --version)
python scripts/bump_build.py
- name: Commit to dev
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Prepare Next Version
branch: dev
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/publish_major.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Increment Version
- name: Remove alpha (declare stable)
run: |
VER=$(python setup.py --version)
python scripts/bump_major.py
python scripts/remove_alpha.py
- name: "Generate release changelog"
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Commit to dev
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Increment Version
commit_message: Declare alpha stable
branch: dev
- name: Push dev -> master
uses: ad-m/github-push-action@master
Expand All @@ -58,6 +58,18 @@ jobs:
- name: Build Distribution Packages
run: |
python setup.py bdist_wheel
- name: Prepare next Major version
run: echo "::set-output name=version::$(python setup.py --version)"
id: alpha
- name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0
run: |
VER=$(python setup.py --version)
python scripts/bump_major.py
- name: Commit to dev
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Prepare Next Version
branch: dev
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/publish_minor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- name: Install Build Tools
run: |
python -m pip install build wheel
- name: Increment Version
- name: Remove alpha (declare stable)
run: |
VER=$(python setup.py --version)
python scripts/bump_minor.py
python scripts/remove_alpha.py
- name: "Generate release changelog"
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Commit to dev
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Increment Version
commit_message: Declare alpha stable
branch: dev
- name: Push dev -> master
uses: ad-m/github-push-action@master
Expand All @@ -58,6 +58,18 @@ jobs:
- name: Build Distribution Packages
run: |
python setup.py bdist_wheel
- name: Prepare next Minor version
run: echo "::set-output name=version::$(python setup.py --version)"
id: alpha
- name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0
run: |
VER=$(python setup.py --version)
python scripts/bump_minor.py
- name: Commit to dev
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Prepare Next Version
branch: dev
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,31 @@ on:
pull_request:
branches:
- dev
paths-ignore:
- 'ovos_utils/version.py'
- 'requirements/**'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'readme.md'
- 'scripts/**'
push:
branches:
- master
paths-ignore:
- 'ovos_utils/version.py'
- 'requirements/**'
- 'examples/**'
- '.github/**'
- '.gitignore'
- 'LICENSE'
- 'CHANGELOG.md'
- 'MANIFEST.in'
- 'readme.md'
- 'scripts/**'
workflow_dispatch:

jobs:
Expand All @@ -33,8 +55,6 @@ jobs:
pip install .
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install .[extras]
pip install pytest pytest-timeout pytest-cov
- name: Run unittests
run: |
Expand Down
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
dev.env
.dev_opts.json
.idea
*.code-workspace
*.pyc
*.swp
*~
*.egg-info/
build
dist
.coverage
/htmlcov
.installed
.mypy_cache
.vscode
.theia
.venv/

# Created by unit tests
.pytest_cache/
13 changes: 13 additions & 0 deletions scripts/remove_alpha.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import fileinput
from os.path import join, dirname


version_file = join(dirname(dirname(__file__)), "ovos_utils", "version.py")

alpha_var_name = "VERSION_ALPHA"

for line in fileinput.input(version_file, inplace=True):
if line.startswith(alpha_var_name):
print(f"{alpha_var_name} = 0")
else:
print(line.rstrip('\n'))

0 comments on commit 9e3c202

Please sign in to comment.