|
8 | 8 | types: [released, prereleased]
|
9 | 9 | workflow_dispatch: # allows running workflow manually from the Actions tab
|
10 | 10 |
|
11 |
| -jobs: |
| 11 | +concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109 |
| 12 | + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} |
| 13 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
12 | 14 |
|
| 15 | +jobs: |
13 | 16 | build-sdist:
|
14 | 17 | runs-on: ubuntu-latest
|
15 | 18 |
|
@@ -86,14 +89,50 @@ jobs:
|
86 | 89 | if: runner.os == 'Linux'
|
87 | 90 | uses: docker/setup-qemu-action@v3
|
88 | 91 |
|
| 92 | + # For Windows, grabbing latest file from MSYS2 is easier than building from source |
| 93 | + # It's generally up to date ref https://packages.msys2.org/base/mingw-w64-file |
| 94 | + - name: Setup MSYS2 and install file |
| 95 | + if: runner.os == 'Windows' |
| 96 | + |
| 97 | + with: |
| 98 | + msystem: ${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }} |
| 99 | + location: D:\ |
| 100 | + install: >- |
| 101 | + ${{ endsWith(matrix.only, '32') && 'mingw-w64-i686-file' || 'mingw-w64-x86_64-file' }} |
| 102 | +
|
| 103 | + # The DLL dependency tree flattened out ref "Dependencies" https://packages.msys2.org/packages/mingw-w64-x86_64-file |
| 104 | + - name: Copy Windows ddl and mgc |
| 105 | + if: runner.os == 'Windows' |
| 106 | + run: | |
| 107 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/share/misc/magic.mgc" "magic" |
| 108 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libmagic-1.dll" "magic" |
| 109 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libsystre-0.dll" "magic" |
| 110 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libtre-5.dll" "magic" |
| 111 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libasprintf-0.dll" "magic" |
| 112 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libintl-8.dll" "magic" |
| 113 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libatomic-1.dll" "magic" |
| 114 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libgomp-1.dll" "magic" |
| 115 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libquadmath-0.dll" "magic" |
| 116 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libstdc++-6.dll" "magic" |
| 117 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libcharset-1.dll" "magic" |
| 118 | + cp "/msys64/${{ endsWith(matrix.only, '32') && 'mingw32' || 'mingw64' }}/bin/libiconv-2.dll" "magic" |
| 119 | +
|
| 120 | + # These are needed additionally in the win32 wheel ref https://packages.msys2.org/packages/mingw-w64-i686-file |
| 121 | + - name: Copy additional 32-bit runtime DLLs |
| 122 | + if: runner.os == 'Windows' && endsWith(matrix.only, '32') |
| 123 | + run: | |
| 124 | + cp "/msys64/mingw32/bin/libgcc_s_dw2-1.dll" "magic" |
| 125 | + cp "/msys64/mingw32/bin/libwinpthread-1.dll" "magic" |
| 126 | +
|
89 | 127 | - uses: pypa/[email protected] # sync version with pip install cibuildwheel above
|
90 | 128 | timeout-minutes: 10
|
91 | 129 | with:
|
92 | 130 | only: ${{ matrix.only }}
|
93 | 131 | env:
|
94 | 132 | CIBW_BUILD_VERBOSITY: 1
|
95 | 133 | # add compiled libmagic to the build directory (to include in the wheel)
|
96 |
| - CIBW_BEFORE_BUILD: ${{ ( startsWith( matrix.os, 'macos' ) && 'sudo -E bash add_libmagic.sh' ) || 'bash add_libmagic.sh' }} |
| 134 | + CIBW_BEFORE_BUILD_MACOS: sudo -E bash add_libmagic.sh |
| 135 | + CIBW_BEFORE_BUILD_LINUX: bash add_libmagic.sh |
97 | 136 | # build macos wheels with maximum backwards compatibility (gcc -mmacosx-version-min flag)
|
98 | 137 | MACOSX_DEPLOYMENT_TARGET: ${{ ( endsWith( matrix.only, 'arm64' ) && '11.0' ) || '10.9' }}
|
99 | 138 | # simple smoke test run on each wheel: this is an HLS MP4 video, only recognised in recent versions of libmagic
|
|
0 commit comments