diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index b4f46ed29..eca6573ff 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -47,7 +47,7 @@ jobs: path: | dist/icloud*.whl - get_expected_version: + get_expected_version_linux: runs-on: ubuntu-22.04 defaults: run: @@ -85,6 +85,43 @@ jobs: outputs: expected_version: ${{steps.get_version.outputs.expected_version}} + get_expected_version_macos: + runs-on: macos-14 + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v4 + + - name: Download version info + uses: actions/download-artifact@v4 + with: + name: icloudpd-${{github.sha}}-version-info + path: | + src/foundation + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install Dev dependencies + run: | + pip3 install --disable-pip-version-check -e . + + - name: Get Version + id: get_version + run: | + echo expected_version=$(TZ=America/Los_Angeles LC_ALL=ru_RU.UTF-8 icloudpd --use-os-locale --version) >> $GITHUB_OUTPUT + + - name: Log version + run: | + echo "expected_version=${{steps.get_version.outputs.expected_version}}" + + outputs: + expected_version: ${{steps.get_version.outputs.expected_version}} + build_linux_apt: runs-on: ubuntu-22.04 strategy: @@ -3322,7 +3359,8 @@ jobs: - compatibility_macos_npx - compatibility_windows_npm - compatibility_windows_npx - - get_expected_version + - get_expected_version_linux + - get_expected_version_macos defaults: run: shell: bash @@ -3375,9 +3413,9 @@ jobs: - name: Compile tzlc Report run: | echo "debugging report..." - scripts/compile_tzlc.py tzlc "${{needs.get_expected_version.outputs.expected_version}}" + scripts/compile_tzlc.py tzlc "${{needs.get_expected_version_linux.outputs.expected_version}}" "${{needs.get_expected_version_macos.outputs.expected_version}}" echo "save report..." - scripts/compile_tzlc.py tzlc "${{needs.get_expected_version.outputs.expected_version}}" > dist/tzlc-${{inputs.icloudpd_version}}.md + scripts/compile_tzlc.py tzlc "${{needs.get_expected_version_linux.outputs.expected_version}}" "${{needs.get_expected_version_macos.outputs.expected_version}}"> dist/tzlc-${{inputs.icloudpd_version}}.md - name: Upload tzlc report uses: actions/upload-artifact@v4 diff --git a/scripts/compile_tzlc.py b/scripts/compile_tzlc.py index 4dbb048e8..19a87f79e 100755 --- a/scripts/compile_tzlc.py +++ b/scripts/compile_tzlc.py @@ -10,15 +10,15 @@ def special_content_checker(expected_content): # content is special when it exists, but is invalid def _intern(filepath): with open(filepath, encoding="UTF-8") as file: - content = file.read() - return content != expected_content + content = file.read().strip() + return content not in expected_content return _intern if __name__ == "__main__": - if len(sys.argv) != 3: - print("Params: ") + if len(sys.argv) < 3: + print("Params: [...]") sys.exit(1) print("## Timezone and Locale Compatibility") print( @@ -26,7 +26,7 @@ def _intern(filepath): ) print("") folder = sys.argv[1] - expected_content = sys.argv[2] + expected_content = [c.strip() for c in sys.argv[2:]] # content is special when it exists, but is invalid print_breakdowns( folder,