55 librabbitmq-c-ref :
66 description : librabbitmq-c git reference to build
77 required : true
8+ php :
9+ description : PHP version to build for
10+ required : true
811 openssl-version :
912 description : OpenSSL Version to build with
1013 required : false
1114 type : choice
1215 options : ['1.1', '3']
1316 default : ' 3'
1417jobs :
15- vs16 :
18+ build :
1619 strategy :
1720 fail-fast : false
1821 matrix :
19- include :
20- - os : windows-2022
21- arch : x64
22- archName : Win64
23- toolset : v142
24- label : vs16
25- - os : windows-2022
26- arch : Win32
27- archName : Win32
28- toolset : v142
29- label : vs16
30- runs-on : ${{ matrix.os }}
22+ arch : [x64, x86]
23+ runs-on : ${{ (inputs.php == '8.6' || inputs.php == 'master') && 'windows-2025-vs2026' || (inputs.php >= '8.0' && 'windows-2022' || 'windows-2019') }}
3124
3225 steps :
26+ - name : Checkout winlib-builder
27+ uses : actions/checkout@v5
28+ with :
29+ path : winlib-builder
30+
3331 - name : Checkout source
3432 uses : actions/checkout@v5
3533 with :
3634 repository : alanxz/rabbitmq-c
3735 ref : ${{ inputs.librabbitmq-c-ref }}
36+ path : rabbitmq-c
3837
39- - name : Install OpenSSL (x64 or Win32)
40- run : |
41- if('${{ inputs.openssl-version }}' -eq '3') {
38+ - name : Compute virtual inputs
39+ id : virtuals
40+ run : powershell winlib-builder/scripts/compute-virtuals -version ${{ inputs.php }} -arch ${{ matrix.arch }}
41+
42+ - name : Install OpenSSL
43+ shell : pwsh
44+ run : |
45+ $archName = '${{ steps.virtuals.outputs.msarch }}'
46+ if ($archName -eq 'Win32') {
47+ $archName = 'Win32'
48+ } else {
49+ $archName = 'Win64'
50+ }
51+ if ('${{ inputs.openssl-version }}' -eq '3') {
4252 $ver = (choco search openssl --exact --limit-output).split('|')[1]
4353 $verUnd = $ver -replace '\.', '_'
44- $archName = '${{ matrix.archName }}'
4554 Start-BitsTransfer -Source "https://slproweb.com/download/${archName}OpenSSL-$verUnd.exe" -Destination openssl-installer.exe
4655 Start-Process -FilePath openssl-installer.exe -ArgumentList '/SP-','/VERYSILENT','/NORESTART',"/DIR=C:\OpenSSL-$archName" -NoNewWindow -Wait
4756 } else {
48- $x86Flag = if ('${{ matrix.arch }}' -ne 'x64') { '-x86' } else { '' }
49- choco install openssl --version=1.1.1.2100 -y -f $x86Flag --install-arguments="'/DIR=C:\OpenSSL-${{ matrix. archName }} '"
57+ $x86Flag = if ('${{ matrix.arch }}' -ne 'x64') { '-x86' } else { '' }
58+ choco install openssl --version=1.1.1.2100 -y -f $x86Flag --install-arguments="'/DIR=C:\OpenSSL-$archName'"
5059 }
5160
5261 - name : Configure with CMake
62+ shell : pwsh
5363 run : |
54- $opensslRoot = 'C:\OpenSSL-${{ matrix.archName }}'
55- mkdir build
56- cd build
57- cmake .. `
58- -G "Visual Studio 17 2022 " `
59- -A ${{ matrix.arch }} `
60- -T "${{ matrix.toolset }}" `
64+ $opensslRoot = 'C:\OpenSSL-${{ steps.virtuals.outputs.msarch == 'Win32' && 'Win32' || 'Win64' }}'
65+ New-Item -Path build -ItemType Directory -Force | Out-Null
66+ Set-Location build
67+ cmake ../rabbitmq-c `
68+ -G "Visual Studio ${{ steps.virtuals.outputs.vsnum }} ${{ steps.virtuals.outputs.vsyear }} " `
69+ -A ${{ steps.virtuals.outputs.msarch }} `
70+ -T "${{ steps.virtuals.outputs.msts }}" `
6171 -DCMAKE_C_FLAGS=" /W4" `
6272 -DOPENSSL_ROOT_DIR="$opensslRoot" `
6373 -DOPENSSL_INCLUDE_DIR="$opensslRoot\include" `
@@ -68,124 +78,21 @@ jobs:
6878 - name : Build & install
6979 run : cmake --build build --config Release --target install
7080
71- - name : Upload build artifact
72- uses : actions/upload-artifact@v4
73- with :
74- name : rabbitmq-c.openssl${{ inputs.openssl-version }}-${{ matrix.label }}-${{ matrix.arch }}
75- path : ${{github.workspace}}/build/install
76- vs17 :
77- # For VS17, we should only build with OpenSSL 3 as 8.4 is built with that.
78- if : ${{ inputs.openssl-version == '3' }}
79- strategy :
80- fail-fast : false
81- matrix :
82- include :
83- - os : windows-2022
84- arch : x64
85- archName : Win64
86- toolset : v143
87- label : vs17
88- - os : windows-2022
89- arch : Win32
90- archName : Win32
91- toolset : v143
92- label : vs17
93- runs-on : ${{ matrix.os }}
81+ - name : Normalize version
82+ id : version
83+ shell : pwsh
84+ run : echo "version=$('${{ inputs.librabbitmq-c-ref }}' -replace '^v')" >> $env:GITHUB_OUTPUT
9485
95- steps :
96- - name : Checkout source
97- uses : actions/checkout@v5
98- with :
99- repository : alanxz/rabbitmq-c
100- ref : ${{ inputs.librabbitmq-c-ref }}
101-
102- - name : Install OpenSSL (x64 or Win32)
103- run : |
104- $ver = (choco search openssl --exact --limit-output).split('|')[1]
105- $verUnd = $ver -replace '\.', '_'
106- $archName = '${{ matrix.archName }}'
107- Start-BitsTransfer -Source "https://slproweb.com/download/${archName}OpenSSL-$verUnd.exe" -Destination openssl-installer.exe
108- Start-Process -FilePath openssl-installer.exe -ArgumentList '/SP-','/VERYSILENT','/NORESTART',"/DIR=C:\OpenSSL-$archName" -NoNewWindow -Wait
109-
110- - name : Configure with CMake
111- run : |
112- $opensslRoot = 'C:\OpenSSL-${{ matrix.archName }}'
113- mkdir build
114- cd build
115- cmake .. `
116- -G "Visual Studio 17 2022" `
117- -A ${{ matrix.arch }} `
118- -T "${{ matrix.toolset }}" `
119- -DCMAKE_C_FLAGS=" /W4" `
120- -DOPENSSL_ROOT_DIR="$opensslRoot" `
121- -DOPENSSL_INCLUDE_DIR="$opensslRoot\include" `
122- -DCMAKE_BUILD_TYPE=Debug `
123- -DBUILD_SHARED_LIBS=ON `
124- -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/install"
125-
126- - name : Build & install
127- run : cmake --build build --config Release --target install
128-
129- - name : Upload build artifact
86+ - name : Upload build artifact for VS16
87+ if : ${{ steps.virtuals.outputs.vs == 'vs16' }}
13088 uses : actions/upload-artifact@v4
13189 with :
132- name : rabbitmq-c.openssl${{ inputs.openssl-version }}-${{ matrix.label }}-${{ matrix.arch }}
90+ name : rabbitmq-c.openssl${{ inputs.openssl-version }}-${{ steps.virtuals.outputs.vs }}-${{ matrix.arch == 'x86' && 'Win32' || matrix.arch }}
13391 path : ${{github.workspace}}/build/install
134- vs18 :
135- # For VS18, we should only build with OpenSSL 3 as 8.6 is built with that.
136- if : ${{ inputs.openssl-version == '3' }}
137- strategy :
138- fail-fast : false
139- matrix :
140- include :
141- - os : windows-2025-vs2026
142- arch : x64
143- archName : Win64
144- toolset : v145
145- label : vs18
146- - os : windows-2025-vs2026
147- arch : Win32
148- archName : Win32
149- toolset : v145
150- label : vs18
151- runs-on : ${{ matrix.os }}
152-
153- steps :
154- - name : Checkout source
155- uses : actions/checkout@v5
156- with :
157- repository : alanxz/rabbitmq-c
158- ref : ${{ inputs.librabbitmq-c-ref }}
159-
160- - name : Install OpenSSL (x64 or Win32)
161- run : |
162- $ver = (choco search openssl --exact --limit-output).split('|')[1]
163- $verUnd = $ver -replace '\.', '_'
164- $archName = '${{ matrix.archName }}'
165- Start-BitsTransfer -Source "https://slproweb.com/download/${archName}OpenSSL-$verUnd.exe" -Destination openssl-installer.exe
166- Start-Process -FilePath openssl-installer.exe -ArgumentList '/SP-','/VERYSILENT','/NORESTART',"/DIR=C:\OpenSSL-$archName" -NoNewWindow -Wait
167-
168- - name : Configure with CMake
169- run : |
170- $opensslRoot = 'C:\OpenSSL-${{ matrix.archName }}'
171- mkdir build
172- cd build
173- cmake .. `
174- -G "Visual Studio 18 2026" `
175- -A ${{ matrix.arch }} `
176- -T "${{ matrix.toolset }}" `
177- -DCMAKE_C_FLAGS=" /W4" `
178- -DOPENSSL_ROOT_DIR="$opensslRoot" `
179- -DOPENSSL_INCLUDE_DIR="$opensslRoot\include" `
180- -DCMAKE_BUILD_TYPE=Debug `
181- -DBUILD_SHARED_LIBS=ON `
182- -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/build/install"
183-
184- - name : Build & install
185- run : cmake --build build --config Release --target install
18692
18793 - name : Upload build artifact
94+ if : ${{ steps.virtuals.outputs.vs != 'vs16' }}
18895 uses : actions/upload-artifact@v4
18996 with :
190- name : rabbitmq-c.openssl ${{ inputs.openssl- version }}-${{ matrix.label }}-${{ matrix.arch }}
97+ name : librabbitmq- ${{ steps. version.outputs.version }}-${{ steps.virtuals.outputs.vs }}-${{ matrix.arch }}
19198 path : ${{github.workspace}}/build/install
0 commit comments