Get QTfiles from iTunes installer #5
This file contains hidden or 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
| name: Get QTfiles from iTunes installer | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| check-and-download: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: [win64, win32] | |
| steps: | |
| - name: Get iTunes URL, UUID, and filename | |
| id: itunes | |
| run: | | |
| arch=${{ matrix.arch }} | |
| url=$(curl -sLI -o /dev/null -w %{url_effective} https://www.apple.com/itunes/download/$arch) | |
| echo url=$url >> $GITHUB_OUTPUT | |
| uuid=$(echo $url | cut -d '/' -f 5) | |
| echo uuid=$uuid >> $GITHUB_OUTPUT | |
| echo $uuid > $arch.txt | |
| echo filename=$(echo $url | cut -d '/' -f 6) >> $GITHUB_OUTPUT | |
| echo arch=${arch^^} >> $GITHUB_OUTPUT | |
| - name: Check if there is newer UUID | |
| run: | | |
| [[ "${{ steps.itunes.outputs.uuid }}" != "${{ vars[format('UUID_{0}', steps.itunes.outputs.arch)] }}" ]] | |
| - name: Download iTunes installer | |
| run: aria2c -x 16 "${{ steps.itunes.outputs.url }}" | |
| - name: Upload iTunes installer | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: iTunes-${{ matrix.arch }} | |
| path: ${{ steps.itunes.outputs.filename }} | |
| retention-days: 1 | |
| compression-level: 0 | |
| - name: Upload iTunes UUID | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: UUID-${{ matrix.arch }} | |
| path: ${{ matrix.arch }}.txt | |
| retention-days: 1 | |
| extract: | |
| needs: check-and-download | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| arch: [QTfiles64, QTfiles] | |
| steps: | |
| - name: Download makeportable | |
| run: Invoke-WebRequest https://raw.githubusercontent.com/nu774/makeportable/master/makeportable2.cmd -OutFile makeportable2.cmd | |
| - name: Download Dummy DLL Generator | |
| run: Invoke-WebRequest $env:GITHUB_SERVER_URL/ykhwong/dummy-dll-generator/releases/latest/download/dummyDLL.exe -OutFile dummyDLL.exe | |
| - name: Download iTunes installer | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: ${{ matrix.arch == 'QTfiles64' && 'iTunes-win64' || 'iTunes-win32' }} | |
| - name: Get iTunes version | |
| id: itunes | |
| run: | | |
| $version = (Get-Item iTunes*.exe).VersionInfo.FileVersion | |
| Add-Content $env:GITHUB_OUTPUT version=$version | |
| - name: Use makeportable to extract | |
| shell: cmd | |
| run: makeportable2.cmd | |
| - name: Get ICU version | |
| id: icu | |
| run: | | |
| $icu_file = Get-ChildItem -Path ${{ matrix.arch }} -Filter "icudt*.dll" -File | |
| $icu_file.Name -match 'icudt(\d+).dll' | |
| $icu_version = $Matches[1] | |
| Add-Content $env:GITHUB_OUTPUT version=$icu_version | |
| - name: Generate dummy ICU | |
| run: | | |
| ./dummyDLL.exe .\${{ matrix.arch }}\icudt${{ steps.icu.outputs.version }}.dll | |
| Move-Item .\${{ matrix.arch }}\icudt${{ steps.icu.outputs.version }}.dll . | |
| Move-Item out.dll .\${{ matrix.arch }}\icudt${{ steps.icu.outputs.version }}.dll | |
| - name: Upload ${{ matrix.arch }} | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ matrix.arch }} | |
| path: | | |
| ${{ matrix.arch }}/*.dll | |
| !${{ matrix.arch }}/api-*.dll | |
| !${{ matrix.arch }}/concrt140.dll | |
| !${{ matrix.arch }}/msvc*.dll | |
| !${{ matrix.arch }}/ucrtbase.dll | |
| !${{ matrix.arch }}/vc*.dll | |
| retention-days: 1 | |
| - name: Upload ${{ matrix.arch }} original ICU | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ matrix.arch }}-ICU | |
| path: icudt${{ steps.icu.outputs.version }}.dll | |
| retention-days: 1 | |
| - name: Upload ${{ matrix.arch }} Visual Studio Runtime | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: ${{ matrix.arch }}-MSVC | |
| path: | | |
| ${{ matrix.arch }}/concrt140.dll | |
| ${{ matrix.arch }}/msvc*.dll | |
| ${{ matrix.arch }}/ucrtbase.dll | |
| ${{ matrix.arch }}/vc*.dll | |
| retention-days: 1 | |
| outputs: | |
| itunes-version: ${{ steps.itunes.outputs.version }} | |
| icu-version: ${{ steps.icu.outputs.version }} | |
| archive: | |
| needs: [check-and-download, extract] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: [QTfiles64, QTfiles] | |
| steps: | |
| - name: Download ${{ matrix.arch }} | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: ${{ matrix.arch }} | |
| path: ${{ matrix.arch }} | |
| - name: Download ${{ matrix.arch }} Visual Studio Runtime | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: ${{ matrix.arch }}-MSVC | |
| path: ${{ matrix.arch }}-MSVC | |
| - name: Download ${{ matrix.arch }} original ICU | |
| uses: actions/download-artifact@v5 | |
| with: | |
| name: ${{ matrix.arch }}-ICU | |
| - name: 7zip ${{ matrix.arch }} | |
| run: 7z a -mx=9 ${{ matrix.arch }}.7z ./${{ matrix.arch }}/* | |
| - name: 7zip ${{ matrix.arch }} Visual Studio Runtime | |
| run: 7z a -mx=9 ${{ matrix.arch }}-MSVC.7z ./${{ matrix.arch }}-MSVC/* | |
| - name: Zstd ${{ matrix.arch }} original ICU | |
| run: zstd -19 icudt${{ needs.extract.outputs.icu-version }}.dll -o ${{ matrix.arch }}-icudt${{ needs.extract.outputs.icu-version }}.dll.zst | |
| - name: Upload ${{ matrix.arch }} | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: 7z-${{ matrix.arch }} | |
| path: ${{ matrix.arch }}.7z | |
| retention-days: 1 | |
| compression-level: 0 | |
| - name: Upload ${{ matrix.arch }} Visual Studio Runtime | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: 7z-${{ matrix.arch }}-MSVC | |
| path: ${{ matrix.arch }}-MSVC.7z | |
| retention-days: 1 | |
| compression-level: 0 | |
| - name: Upload ${{ matrix.arch }} original ICU | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: 7z-${{ matrix.arch }}-ICU | |
| path: ${{ matrix.arch }}-icudt${{ needs.extract.outputs.icu-version }}.dll.zst | |
| retention-days: 1 | |
| compression-level: 0 | |
| release: | |
| permissions: | |
| contents: write | |
| needs: [check-and-download, extract, archive] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all archives | |
| uses: actions/download-artifact@v5 | |
| with: | |
| pattern: 7z-* | |
| merge-multiple: true | |
| - name: Release | |
| run: | | |
| gh release create "v${{ needs.extract.outputs.itunes-version }}" \ | |
| {QTfiles64,QTfiles}.7z \ | |
| {QTfiles64,QTfiles}-MSVC.7z \ | |
| {QTfiles64,QTfiles}-icudt${{ needs.extract.outputs.icu-version }}.dll.zst \ | |
| -n "Extracted from the version ${{ needs.extract.outputs.itunes-version }} of Windows iTunes. | |
| International Components for Unicode data version ${{ needs.extract.outputs.icu-version }}" \ | |
| -t "QTFiles v${{ needs.extract.outputs.itunes-version }}" | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| - name: Download UUID | |
| uses: actions/download-artifact@v5 | |
| with: | |
| pattern: UUID-* | |
| merge-multiple: true | |
| - name: Update UUID | |
| run: | | |
| gh variable set UUID_WIN64 < win64.txt | |
| gh variable set UUID_WIN32 < win32.txt | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_PAT }} | |
| GH_REPO: ${{ github.repository }} |