Skip to content

Commit cfe5cc9

Browse files
authored
Use semantic versioning (#30)
* git: use semver * gh: bump minor version
1 parent d7d3362 commit cfe5cc9

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
if: github.event.pull_request.draft == false
2121
runs-on: ubuntu-latest
2222
container:
23-
image: faasm.azurecr.io/cpython:0.2.6
23+
image: faasm.azurecr.io/cpython:0.3.0
2424
credentials:
2525
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
2626
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}
@@ -44,7 +44,7 @@ jobs:
4444
REDIS_QUEUE_HOST: redis
4545
REDIS_STATE_HOST: redis
4646
container:
47-
image: faasm.azurecr.io/cpython:0.2.6
47+
image: faasm.azurecr.io/cpython:0.3.0
4848
credentials:
4949
username: ${{ secrets.ACR_SERVICE_PRINCIPAL_ID }}
5050
password: ${{ secrets.ACR_SERVICE_PRINCIPAL_PASSWORD }}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.6
1+
0.3.0

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
black==22.3.0
2-
faasmctl==0.5.6
2+
faasmctl==0.7.1
33
flake8==3.9.2
44
invoke>=2.0.0
55
numpy==1.22.0

tasks/git.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,32 @@ def get_tag_name(version):
1414

1515

1616
@task
17-
def bump(ctx, ver=None):
17+
def bump(ctx, patch=False, minor=False, major=False):
1818
"""
19-
Bump code version
19+
Bump the code version by --patch, --minor, or --major
2020
"""
2121
old_ver = get_version()
22-
23-
if ver:
24-
new_ver = ver
22+
new_ver_parts = old_ver.split(".")
23+
24+
if patch:
25+
idx = 2
26+
elif minor:
27+
idx = 1
28+
elif major:
29+
idx = 0
2530
else:
26-
# Just bump the last minor version part
27-
new_ver_parts = old_ver.split(".")
28-
new_ver_minor = int(new_ver_parts[-1]) + 1
29-
new_ver_parts[-1] = str(new_ver_minor)
30-
new_ver = ".".join(new_ver_parts)
31+
raise RuntimeError("Must set one in: --[patch,minor,major]")
32+
33+
# Change the corresponding idx
34+
new_ver_parts[idx] = str(int(new_ver_parts[idx]) + 1)
35+
36+
# Zero-out the following version numbers (i.e. lower priority). This is
37+
# because if we tag a new major release, we want to zero-out the minor
38+
# and patch versions (e.g. 0.2.0 comes after 0.1.9)
39+
for next_idx in range(idx + 1, 3):
40+
new_ver_parts[next_idx] = "0"
41+
42+
new_ver = ".".join(new_ver_parts)
3143

3244
# Replace version in all files
3345
for f in VERSIONED_FILES:

0 commit comments

Comments
 (0)