Skip to content

Commit 3681811

Browse files
committed
Use the pre-build binaries of the dependencies in the Windows build.
1 parent 16ea12a commit 3681811

File tree

6 files changed

+143
-13
lines changed

6 files changed

+143
-13
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@echo off
2+
3+
set "SCRIPT_DIR=%~dp0"
4+
set "EXECUTION_DIR=%cd%"
5+
6+
call "%SCRIPT_DIR%find-bash.cmd"
7+
8+
call set "PATH=%%SCRIPT_DIR:%EXECUTION_DIR%=%%"
9+
call set "LINUX_PATH=%PATH:\=/%"
10+
11+
%BASH% -c "./%LINUX_PATH%/download-configure.sh"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#/bin/bash
2+
set -e
3+
4+
download_release()
5+
{
6+
local project=$1
7+
local release=$2
8+
local file=$3
9+
10+
echo "Downloading $file from release $release of $project"
11+
12+
curl -sS -L "https://github.com/ImageMagick/$project/releases/download/$release/$file" -o "$file"
13+
}
14+
15+
download_configure()
16+
{
17+
local version=$1
18+
19+
mkdir -p "Configure"
20+
cd "Configure"
21+
22+
download_release "Configure" "$version" "Configure.Release.x64.exe"
23+
download_release "Configure" "$version" "Configure.Release.arm64.exe"
24+
download_release "Configure" "$version" "Configure.Release.x86.exe"
25+
download_release "Configure" "$version" "files.zip"
26+
unzip -o "files.zip" && rm "files.zip"
27+
28+
cd ..
29+
}
30+
31+
download_configure "2025.07.15.0637"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@echo off
2+
3+
set "SCRIPT_DIR=%~dp0"
4+
set "EXECUTION_DIR=%cd%"
5+
6+
call "%SCRIPT_DIR%find-bash.cmd"
7+
8+
call set "PATH=%%SCRIPT_DIR:%EXECUTION_DIR%=%%"
9+
call set "LINUX_PATH=%PATH:\=/%"
10+
11+
%BASH% -c "./%LINUX_PATH%/download-dependencies.sh --dependencies-artifact %1"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#/bin/bash
2+
set -e
3+
4+
download_release()
5+
{
6+
local project=$1
7+
local release=$2
8+
local file=$3
9+
10+
echo "Downloading $file from release $release of $project"
11+
12+
curl -sS -L "https://github.com/ImageMagick/$project/releases/download/$release/$file" -o "$file"
13+
}
14+
15+
download_dependencies()
16+
{
17+
local version=$1
18+
local artifact=$2
19+
20+
mkdir -p "Dependencies"
21+
cd "Dependencies"
22+
23+
download_release "Dependencies" "$version" "$artifact"
24+
unzip -o "$artifact" -d "../Artifacts" || {
25+
exit_code=$?
26+
if [[ $exit_code -ne 0 && $exit_code -ne 1 ]]; then
27+
echo "Unzip failed with exit code $exit_code"
28+
exit $exit_code
29+
fi
30+
}
31+
32+
cd ..
33+
}
34+
35+
dependenciesArtifact=""
36+
37+
while [[ $# -gt 0 ]]; do
38+
case $1 in
39+
--dependencies-artifact)
40+
dependenciesArtifact="$2"
41+
shift 2
42+
;;
43+
*)
44+
echo "Unknown option: $1"
45+
exit 1
46+
;;
47+
esac
48+
done
49+
50+
if [[ -z "$dependenciesArtifact" ]]; then
51+
echo "Error: The --dependencies-artifact option is required."
52+
exit 1
53+
fi
54+
55+
download_dependencies "2025.07.15.2108" "$dependenciesArtifact"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
set BASH="%PROGRAMFILES%\Git\bin\bash.exe"
2+
if exist %BASH% goto EXECUTE
3+
4+
set BASH="%PROGRAMFILES(x86)%\Git\bin\bash.exe"
5+
if exist %BASH% goto EXECUTE
6+
7+
set BASH="%ProgramW6432%\Git\bin\bash.exe"
8+
if exist %BASH% goto EXECUTE
9+
10+
set BASH="%USERPROFILE%\scoop\apps\git\current\bin\bash.exe"
11+
if exist %BASH% goto EXECUTE
12+
13+
for /F "tokens=*" %%g in ('where bash') do (SET BASH=%%g)
14+
if exist %BASH% goto EXECUTE
15+
16+
echo Failed to find bash.exe
17+
echo %BASH%
18+
exit /b 1
19+
20+
:EXECUTE

.github/workflows/main.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,38 +73,40 @@ jobs:
7373
make install
7474
7575
build_windows:
76-
name: Build Windows
76+
name: Build Windows ${{matrix.architecture}}
7777
runs-on: windows-2022
7878

79+
strategy:
80+
fail-fast: false
81+
matrix:
82+
architecture: [ x64, x86 ]
83+
7984
steps:
8085
- uses: actions/checkout@v4
8186
with:
8287
path: ImageMagick
8388

84-
- uses: actions/checkout@v4
85-
with:
86-
repository: ImageMagick/ImageMagick-Windows
87-
path: ImageMagick-Windows
88-
ref: refs/heads/main
89+
- name: Download configure
90+
shell: cmd
91+
run: |
92+
ImageMagick\.github\build\windows\download-configure.cmd
8993
90-
- name: Clone repositories
94+
- name: Download dependencies
9195
shell: cmd
9296
run: |
93-
cd ImageMagick-Windows
94-
CloneRepositories.IM6.cmd
97+
ImageMagick\.github\build\windows\download-dependencies.cmd windows-${{matrix.architecture}}-static-openMP.zip
9598
9699
- name: Configure ImageMagick
97100
shell: cmd
101+
working-directory: Configure
98102
run: |
99-
cd ImageMagick-Windows\Configure
100-
Configure.Release.x64.exe /noWizard /VS2022 /x64 /smtd
103+
Configure.Release.x64.exe /noWizard /VS2022 /${{matrix.architecture}} /static
101104
102105
- name: Build ImageMagick
103106
shell: cmd
104107
run: |
105108
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
106-
cd ImageMagick-Windows
107-
msbuild IM6.StaticDLL.x64.sln /m /t:Rebuild /p:Configuration=Release,Platform=x64
109+
msbuild IM6.StaticDLL.${{matrix.architecture}}.sln /m /t:Rebuild /p:Configuration=Release,Platform=x64
108110
109111
build_msys2:
110112
name: Build MSYS2

0 commit comments

Comments
 (0)