Skip to content

Commit 67fbed1

Browse files
add version to compatibility reports
1 parent 10db621 commit 67fbed1

File tree

3 files changed

+72
-11
lines changed

3 files changed

+72
-11
lines changed

.github/workflows/build-package.yml

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,49 @@ jobs:
4848
path: |
4949
dist/icloudpd*.whl
5050
51+
get_version_thumbprint:
52+
runs-on: ubuntu-22.04
53+
defaults:
54+
run:
55+
shell: bash
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Download version info
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: icloudpd-version-info
64+
path: |
65+
src/foundation
66+
67+
- name: Set up Python 3.13
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: '3.13'
71+
72+
- name: Install
73+
run: >
74+
export DEBIAN_FRONTEND=noninteractive && sudo apt-get update && sudo apt-get install -y tzdata locales-all &&
75+
python3 -m pip install --disable-pip-version-check -r requirements-pip.txt &&
76+
pip3 install --disable-pip-version-check -e .
77+
78+
- name: Get Version
79+
id: get_version
80+
run: |
81+
icloudpd --version > dist/icloudpd-version-thumbprint.txt
82+
83+
- name: Log version
84+
run: |
85+
cat dist/icloudpd-version-thumbprint.txt
86+
87+
- name: Upload artifacts
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: icloudpd-version-thumbprint
91+
if-no-files-found: error
92+
path: |
93+
dist/icloudpd-version-thumbprint.txt
5194
5295
get_expected_version_linux_apt:
5396
runs-on: ubuntu-22.04
@@ -3832,6 +3875,7 @@ jobs:
38323875
- get_expected_version_linux_apt
38333876
- get_expected_version_linux_apk
38343877
- get_expected_version_macos
3878+
- get_version_thumbprint
38353879
defaults:
38363880
run:
38373881
shell: bash
@@ -3866,12 +3910,18 @@ jobs:
38663910
path: |
38673911
tzlc
38683912
3913+
- name: Download Version
3914+
uses: actions/download-artifact@v4
3915+
with:
3916+
pattern: icloudpd-version-thumbprint
3917+
merge-multiple: true
3918+
path: |
3919+
dist
3920+
38693921
- name: Compile Compatibility Report
38703922
run: |
3871-
echo "debugging report..."
3872-
scripts/compile_compatibility.py compatibility
38733923
echo "save report..."
3874-
scripts/compile_compatibility.py compatibility > dist/compatibility-${{inputs.icloudpd_version}}.md
3924+
scripts/compile_compatibility.py dist/icloudpd-version-thumbprint.txt compatibility > tee dist/compatibility-${{inputs.icloudpd_version}}.md
38753925
38763926
- name: Upload compatibility report
38773927
uses: actions/upload-artifact@v4
@@ -3884,9 +3934,7 @@ jobs:
38843934
- name: Compile tzlc Report
38853935
run: |
38863936
echo "save report..."
3887-
scripts/compile_tzlc.py tzlc "${{needs.get_expected_version_linux_apt.outputs.expected_version}}" "${{needs.get_expected_version_linux_apk.outputs.expected_version}}" "${{needs.get_expected_version_macos.outputs.expected_version}}"> dist/tzlc-${{inputs.icloudpd_version}}.md
3888-
echo "debugging report..."
3889-
cat dist/tzlc-${{inputs.icloudpd_version}}.md
3937+
scripts/compile_tzlc.py dist/icloudpd-version-thumbprint.txt tzlc "${{needs.get_expected_version_linux_apt.outputs.expected_version}}" "${{needs.get_expected_version_linux_apk.outputs.expected_version}}" "${{needs.get_expected_version_macos.outputs.expected_version}}" > tee dist/tzlc-${{inputs.icloudpd_version}}.md
38903938
38913939
- name: Upload tzlc report
38923940
uses: actions/upload-artifact@v4

scripts/compile_compatibility.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,18 @@ def content_checker(filepath):
1212

1313

1414
if __name__ == "__main__":
15+
if len(sys.argv) < 2:
16+
print("Params: <version-thumbprint-file> [folder]")
17+
sys.exit(1)
1518
print("## Minimal Effort Compatibility")
1619
print(
1720
"Checks if `icloudpd` can be installed using minimal effort and ran bare minimum functionality of displaying a version information. Minimal effort may require installing default version of package manager using OS tools"
1821
)
1922
print("")
20-
folder = sys.argv[1] if len(sys.argv) > 1 else "."
23+
version_thumbprint_file = sys.argv[1]
24+
with open(version_thumbprint_file, "r") as file:
25+
version_thumbprint = file.read()
26+
print(f"Version: {version_thumbprint}")
27+
print("")
28+
folder = sys.argv[2] if len(sys.argv) > 2 else "."
2129
print_breakdowns(folder, content_checker, ("(src)", "Test pass using src (for pip)"))

scripts/compile_tzlc.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@ def _intern(filepath):
1717

1818

1919
if __name__ == "__main__":
20-
if len(sys.argv) < 3:
21-
print("Params: <folder> <expected content> [<expected content>...]")
20+
if len(sys.argv) < 4:
21+
print("Params: <version-thumbprint-file> <folder> <expected content> [<expected content>...]")
2222
sys.exit(1)
2323
print("## Timezone and Locale Compatibility")
2424
print(
2525
"Checks if `icloudpd` can be installed using minimal effort and ran bare minimum functionality of displaying version and commit timestamp in local timezone and RU locale. Minimal effort may require installing default version of package manager, timezone data, and locales using OS tools"
2626
)
2727
print("")
28-
folder = sys.argv[1]
29-
expected_content = [c.strip() for c in sys.argv[2:]]
28+
version_thumbprint_file = sys.argv[1]
29+
with open(version_thumbprint_file, "r") as file:
30+
version_thumbprint = file.read()
31+
print(f"Version: {version_thumbprint}")
32+
print("")
33+
folder = sys.argv[2]
34+
expected_content = [c.strip() for c in sys.argv[3:]]
3035
# content is special when it exists, but is invalid
3136
print_breakdowns(
3237
folder,

0 commit comments

Comments
 (0)