Skip to content

Commit 00288b0

Browse files
authored
Remove workflows (#439)
1 parent 883ece4 commit 00288b0

File tree

4 files changed

+11
-96
lines changed

4 files changed

+11
-96
lines changed

.github/workflows/update-packages.yml

-32
This file was deleted.

.github/workflows/update-version.yml

-40
This file was deleted.

.github/workflows/update_packages.py

-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4-
import os
54
import random
65
import subprocess
76

@@ -27,10 +26,6 @@ def main():
2726
print("No changes detected, exiting")
2827
return
2928

30-
print("Git Config")
31-
subprocess.run(["git", "config", "user.email", os.getenv("UPDATER_AUTHOR")], check=True)
32-
subprocess.run(["git", "config", "user.name", os.getenv("UPDATER_EMAIL")], check=True)
33-
3429
print("Committing changes")
3530
subprocess.run(["git", "add", "--all", "."], check=True)
3631

@@ -39,12 +34,6 @@ def main():
3934
check=True,
4035
)
4136

42-
print("Creating a PR")
43-
subprocess.run(
44-
["gh", "pr", "create", "--fill", "--base", "main", "--head", branch_name],
45-
check=True,
46-
)
47-
4837

4938
if __name__ == "__main__":
5039
main()

.github/workflows/update_version.py

+11-13
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
import os
77
import random
88
import subprocess
9+
import sys
910

1011
from datetime import datetime
1112

13+
1214
def get_next_odd_number(number: int) -> int:
1315
"""Returns the next odd number."""
1416
return number + 1 if number % 2 == 0 else number + 2
@@ -23,10 +25,16 @@ def main():
2325
package_json = pathlib.Path("package.json")
2426
package = json.loads(package_json.read_text(encoding="utf-8"))
2527
version = package["version"].split(".")
26-
release_type = os.getenv("RELEASE_TYPE", None)
28+
release_type = os.getenv("RELEASE_TYPE", sys.argv[-1])
2729
if release_type == "release":
28-
version[0] = str(datetime.now().year)
29-
version[1] = str(get_next_even_number(int(version[1])))
30+
year = str(datetime.now().year)
31+
if year == version[0]:
32+
# If year is the same only update minor
33+
version[1] = str(get_next_even_number(int(version[1])))
34+
else:
35+
# If new year, update major and reset minor
36+
version[0] = year
37+
version[1] = "0"
3038
version[2] = "0"
3139
elif release_type == "pre-release":
3240
# For pre-release we don't bump major
@@ -54,10 +62,6 @@ def main():
5462
print("Running npm install")
5563
subprocess.run(["npm", "install"], check=True, shell=True)
5664

57-
print("Git Config")
58-
subprocess.run(["git", "config", "user.email", os.getenv("UPDATER_AUTHOR")], check=True)
59-
subprocess.run(["git", "config", "user.name", os.getenv("UPDATER_EMAIL")], check=True)
60-
6165
print("Committing changes")
6266
subprocess.run(["git", "add", "package.json"], check=True)
6367
subprocess.run(["git", "add", "package-lock.json"], check=True)
@@ -66,12 +70,6 @@ def main():
6670
check=True,
6771
)
6872

69-
print("Creating a PR")
70-
subprocess.run(
71-
["gh", "pr", "create", "--fill", "--base", "main", "--head", branch_name],
72-
check=True,
73-
)
74-
7573

7674
if __name__ == "__main__":
7775
main()

0 commit comments

Comments
 (0)