-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: dev | ||
ref: master | ||
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | ||
- name: Setup Python | ||
uses: actions/setup-python@v1 | ||
|
@@ -35,7 +35,7 @@ jobs: | |
python -m pip install build wheel | ||
- name: Remove Alpha tag | ||
run: | | ||
python scripts/remove_alpha.py | ||
python scripts/remove_alpha.py --version-file $GITHUB_WORKSPACE/tutubo/version.py | ||
- name: "Generate release changelog" | ||
uses: heinrichreimer/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
""" | ||
on merge to master -> declare stable (remove alpha) | ||
""" | ||
import argparse | ||
import fileinput | ||
from os.path import join, dirname | ||
import sys | ||
from os.path import abspath, join, dirname | ||
|
||
# TODO - read from env var to allow script to be reused | ||
VERSION_FILE = f"{dirname(dirname(__file__))}/tutubo/version.py" | ||
|
||
alpha_var_name = "VERSION_ALPHA" | ||
def update_alpha(version_file): | ||
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')) | ||
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')) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser( | ||
description='Update the version based on the specified part (major, minor, build, alpha)') | ||
parser.add_argument('--version-file', help='Path to the version.py file', required=True) | ||
|
||
args = parser.parse_args() | ||
|
||
update_alpha(abspath(args.version_file)) |