Skip to content

Commit f41a835

Browse files
committed
feat/packaging workflows
1 parent ccaae37 commit f41a835

File tree

8 files changed

+112
-12
lines changed

8 files changed

+112
-12
lines changed

.github/workflows/build_tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ on:
66
pull_request:
77
branches:
88
- dev
9+
paths-ignore:
10+
- 'ovos_utils/version.py'
11+
- 'test/**'
12+
- 'examples/**'
13+
- '.github/**'
14+
- '.gitignore'
15+
- 'LICENSE'
16+
- 'CHANGELOG.md'
17+
- 'MANIFEST.in'
18+
- 'readme.md'
19+
- 'scripts/**'
920
workflow_dispatch:
1021

1122
jobs:

.github/workflows/publish_alpha.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77
- dev
88
paths-ignore:
99
- 'ovos_utils/version.py'
10-
- 'setup.py'
1110
- 'test/**'
1211
- 'examples/**'
1312
- '.github/**'
13+
- '.gitignore'
1414
- 'LICENSE'
1515
- 'CHANGELOG.md'
1616
- 'MANIFEST.in'

.github/workflows/publish_build.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- name: Install Build Tools
2020
run: |
2121
python -m pip install build wheel
22-
- name: Increment Version
22+
- name: Remove alpha (declare stable)
2323
run: |
2424
VER=$(python setup.py --version)
25-
python scripts/bump_build.py
25+
python scripts/remove_alpha.py
2626
- name: "Generate release changelog"
2727
uses: heinrichreimer/github-changelog-generator-action@v2.3
2828
with:
@@ -31,7 +31,7 @@ jobs:
3131
- name: Commit to dev
3232
uses: stefanzweifel/git-auto-commit-action@v4
3333
with:
34-
commit_message: Increment Version
34+
commit_message: Declare alpha stable
3535
branch: dev
3636
- name: Push dev -> master
3737
uses: ad-m/github-push-action@master
@@ -58,6 +58,18 @@ jobs:
5858
- name: Build Distribution Packages
5959
run: |
6060
python setup.py bdist_wheel
61+
- name: Prepare next Build version
62+
run: echo "::set-output name=version::$(python setup.py --version)"
63+
id: alpha
64+
- name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0
65+
run: |
66+
VER=$(python setup.py --version)
67+
python scripts/bump_build.py
68+
- name: Commit to dev
69+
uses: stefanzweifel/git-auto-commit-action@v4
70+
with:
71+
commit_message: Prepare Next Version
72+
branch: dev
6173
- name: Publish to Test PyPI
6274
uses: pypa/gh-action-pypi-publish@master
6375
with:

.github/workflows/publish_major.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- name: Install Build Tools
2020
run: |
2121
python -m pip install build wheel
22-
- name: Increment Version
22+
- name: Remove alpha (declare stable)
2323
run: |
2424
VER=$(python setup.py --version)
25-
python scripts/bump_major.py
25+
python scripts/remove_alpha.py
2626
- name: "Generate release changelog"
2727
uses: heinrichreimer/github-changelog-generator-action@v2.3
2828
with:
@@ -31,7 +31,7 @@ jobs:
3131
- name: Commit to dev
3232
uses: stefanzweifel/git-auto-commit-action@v4
3333
with:
34-
commit_message: Increment Version
34+
commit_message: Declare alpha stable
3535
branch: dev
3636
- name: Push dev -> master
3737
uses: ad-m/github-push-action@master
@@ -58,6 +58,18 @@ jobs:
5858
- name: Build Distribution Packages
5959
run: |
6060
python setup.py bdist_wheel
61+
- name: Prepare next Major version
62+
run: echo "::set-output name=version::$(python setup.py --version)"
63+
id: alpha
64+
- name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0
65+
run: |
66+
VER=$(python setup.py --version)
67+
python scripts/bump_major.py
68+
- name: Commit to dev
69+
uses: stefanzweifel/git-auto-commit-action@v4
70+
with:
71+
commit_message: Prepare Next Version
72+
branch: dev
6173
- name: Publish to Test PyPI
6274
uses: pypa/gh-action-pypi-publish@master
6375
with:

.github/workflows/publish_minor.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- name: Install Build Tools
2020
run: |
2121
python -m pip install build wheel
22-
- name: Increment Version
22+
- name: Remove alpha (declare stable)
2323
run: |
2424
VER=$(python setup.py --version)
25-
python scripts/bump_minor.py
25+
python scripts/remove_alpha.py
2626
- name: "Generate release changelog"
2727
uses: heinrichreimer/github-changelog-generator-action@v2.3
2828
with:
@@ -31,7 +31,7 @@ jobs:
3131
- name: Commit to dev
3232
uses: stefanzweifel/git-auto-commit-action@v4
3333
with:
34-
commit_message: Increment Version
34+
commit_message: Declare alpha stable
3535
branch: dev
3636
- name: Push dev -> master
3737
uses: ad-m/github-push-action@master
@@ -58,6 +58,18 @@ jobs:
5858
- name: Build Distribution Packages
5959
run: |
6060
python setup.py bdist_wheel
61+
- name: Prepare next Minor version
62+
run: echo "::set-output name=version::$(python setup.py --version)"
63+
id: alpha
64+
- name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0
65+
run: |
66+
VER=$(python setup.py --version)
67+
python scripts/bump_minor.py
68+
- name: Commit to dev
69+
uses: stefanzweifel/git-auto-commit-action@v4
70+
with:
71+
commit_message: Prepare Next Version
72+
branch: dev
6173
- name: Publish to Test PyPI
6274
uses: pypa/gh-action-pypi-publish@master
6375
with:

.github/workflows/unit_tests.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,31 @@ on:
55
pull_request:
66
branches:
77
- dev
8+
paths-ignore:
9+
- 'ovos_utils/version.py'
10+
- 'requirements/**'
11+
- 'examples/**'
12+
- '.github/**'
13+
- '.gitignore'
14+
- 'LICENSE'
15+
- 'CHANGELOG.md'
16+
- 'MANIFEST.in'
17+
- 'readme.md'
18+
- 'scripts/**'
819
push:
920
branches:
1021
- master
22+
paths-ignore:
23+
- 'ovos_utils/version.py'
24+
- 'requirements/**'
25+
- 'examples/**'
26+
- '.github/**'
27+
- '.gitignore'
28+
- 'LICENSE'
29+
- 'CHANGELOG.md'
30+
- 'MANIFEST.in'
31+
- 'readme.md'
32+
- 'scripts/**'
1133
workflow_dispatch:
1234

1335
jobs:
@@ -33,8 +55,6 @@ jobs:
3355
pip install .
3456
- name: Install test dependencies
3557
run: |
36-
python -m pip install --upgrade pip
37-
pip install .[extras]
3858
pip install pytest pytest-timeout pytest-cov
3959
- name: Run unittests
4060
run: |

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
dev.env
2+
.dev_opts.json
3+
.idea
4+
*.code-workspace
5+
*.pyc
6+
*.swp
7+
*~
8+
*.egg-info/
9+
build
10+
dist
11+
.coverage
12+
/htmlcov
13+
.installed
14+
.mypy_cache
15+
.vscode
16+
.theia
17+
.venv/
18+
19+
# Created by unit tests
20+
.pytest_cache/

scripts/remove_alpha.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import fileinput
2+
from os.path import join, dirname
3+
4+
5+
version_file = join(dirname(dirname(__file__)), "ovos_utils", "version.py")
6+
7+
alpha_var_name = "VERSION_ALPHA"
8+
9+
for line in fileinput.input(version_file, inplace=True):
10+
if line.startswith(alpha_var_name):
11+
print(f"{alpha_var_name} = 0")
12+
else:
13+
print(line.rstrip('\n'))

0 commit comments

Comments
 (0)