Skip to content

Video editing with Python

Fix Windows CI workflow (#1690)

Álvaro Mondéjar033542875d21
diff --git a/.github/workflows/format_check.yml b/.github/workflows/format_check.yml
index 1ef9158f..7583c712 100644
--- a/.github/workflows/format_check.yml
+++ b/.github/workflows/format_check.yml
@@ -21,10 +21,10 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
- python-version: '3.x'
+ python-version: 3.9
- name: Install dependencies
run: |
- python -m pip install --upgrade pip
+ python -m pip install --upgrade wheel pip
pip install .[lint]
- name: Lint examples
run: flake8 examples --show-source
diff --git a/.github/workflows/test_suite.yml b/.github/workflows/test_suite.yml
index 54c6f5ea..e41c0c39 100644
--- a/.github/workflows/test_suite.yml
+++ b/.github/workflows/test_suite.yml
@@ -82,13 +82,15 @@ jobs:
with:
path: |
ImageMagick.exe
- key: ${{ runner.os }}-6.9.12
+ key: ${{ runner.os }}-latest
- name: Download ImageMagick installer
shell: cmd
if: steps.imagemagick-installer-cache.outputs.cache-hit != 'true'
run: |
- set IMAGEMAGICK_URL=https://download.imagemagick.org/ImageMagick/download/binaries/ImageMagick-6.9.12-19-Q16-x86-static.exe
+ python3 scripts/get-latest-imagemagick-win.py >im-url.txt
+ set /p IMAGEMAGICK_URL= <im-url.txt
+ rm im-url.txt
echo %IMAGEMAGICK_URL%
curl %IMAGEMAGICK_URL% -o ImageMagick.exe
@@ -104,7 +106,7 @@ jobs:
dir imagemagick
move imagemagick\ffmpeg.exe ffmpeg.exe
- move imagemagick\convert.exe convert.exe
+ move imagemagick\magick.exe convert.exe
- name: Install Python dependencies
run: |
diff --git a/scripts/get-latest-imagemagick-win.py b/scripts/get-latest-imagemagick-win.py
new file mode 100644
index 00000000..b48cc803
--- /dev/null
+++ b/scripts/get-latest-imagemagick-win.py
@@ -0,0 +1,12 @@
+import sys
+from urllib.request import urlopen
+
+BINARIES_URL = "https://download.imagemagick.org/ImageMagick/download/binaries/"
+
+content = urlopen(BINARIES_URL).read().decode("utf-8")
+
+for line in reversed(content.split("<td>")):
+ if 'static.exe">ImageMagick' in line:
+ filename = line.split('"')[1]
+ sys.stdout.write(f"{BINARIES_URL}{filename}\n")
+ break