Skip to content

Commit 04558f4

Browse files
add version thumbprint to compatibility reports (#1174)
1 parent 1b78350 commit 04558f4

File tree

3 files changed

+71
-11
lines changed

3 files changed

+71
-11
lines changed

.github/workflows/build-package.yml

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,46 @@ 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+
mkdir -p dist &&
82+
icloudpd --version | tee dist/icloudpd-version-thumbprint.txt
83+
84+
- name: Upload artifacts
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: icloudpd-version-thumbprint
88+
if-no-files-found: error
89+
path: |
90+
dist/icloudpd-version-thumbprint.txt
5191
5292
get_expected_version_linux_apt:
5393
runs-on: ubuntu-22.04
@@ -3832,6 +3872,7 @@ jobs:
38323872
- get_expected_version_linux_apt
38333873
- get_expected_version_linux_apk
38343874
- get_expected_version_macos
3875+
- get_version_thumbprint
38353876
defaults:
38363877
run:
38373878
shell: bash
@@ -3866,12 +3907,18 @@ jobs:
38663907
path: |
38673908
tzlc
38683909
3910+
- name: Download Version
3911+
uses: actions/download-artifact@v4
3912+
with:
3913+
pattern: icloudpd-version-thumbprint
3914+
merge-multiple: true
3915+
path: |
3916+
dist
3917+
38693918
- name: Compile Compatibility Report
38703919
run: |
3871-
echo "debugging report..."
3872-
scripts/compile_compatibility.py compatibility
38733920
echo "save report..."
3874-
scripts/compile_compatibility.py compatibility > dist/compatibility-${{inputs.icloudpd_version}}.md
3921+
scripts/compile_compatibility.py dist/icloudpd-version-thumbprint.txt compatibility | tee dist/compatibility-${{inputs.icloudpd_version}}.md
38753922
38763923
- name: Upload compatibility report
38773924
uses: actions/upload-artifact@v4
@@ -3884,9 +3931,7 @@ jobs:
38843931
- name: Compile tzlc Report
38853932
run: |
38863933
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
3934+
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
38903935
38913936
- name: Upload tzlc report
38923937
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) 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: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,23 @@ 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(
22+
"Params: <version-thumbprint-file> <folder> <expected content> [<expected content>...]"
23+
)
2224
sys.exit(1)
2325
print("## Timezone and Locale Compatibility")
2426
print(
2527
"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"
2628
)
2729
print("")
28-
folder = sys.argv[1]
29-
expected_content = [c.strip() for c in sys.argv[2:]]
30+
version_thumbprint_file = sys.argv[1]
31+
with open(version_thumbprint_file) as file:
32+
version_thumbprint = file.read()
33+
print(f"Version: {version_thumbprint}")
34+
print("")
35+
folder = sys.argv[2]
36+
expected_content = [c.strip() for c in sys.argv[3:]]
3037
# content is special when it exists, but is invalid
3138
print_breakdowns(
3239
folder,

0 commit comments

Comments
 (0)