4444 type : string
4545 default : ' nightly'
4646 description : ' The channel to use for this job'
47+ cortex-llamacpp-version :
48+ required : true
49+ type : string
50+ default : ' 0.0.0'
51+ description : ' The version of cortex-llamacpp to use for this job'
4752 secrets :
4853 MINIO_BUCKET_NAME :
4954 required : false
@@ -104,6 +109,7 @@ jobs:
104109 echo "::set-output name=configuration_file_name::.cortexrc"
105110 echo "::set-output name=uninstaller_file_name::cortex-uninstall.sh"
106111 echo "::set-output name=iss_file_name::installer.iss"
112+ echo "::set-output name=local_iss_file_name::local-installer.iss"
107113 fi
108114
109115 # Set output for beta channel
@@ -114,6 +120,7 @@ jobs:
114120 echo "::set-output name=configuration_file_name::.cortexrc-beta"
115121 echo "::set-output name=uninstaller_file_name::cortex-beta-uninstall.sh"
116122 echo "::set-output name=iss_file_name::installer-beta.iss"
123+ echo "::set-output name=local_iss_file_name::local-installer-beta.iss"
117124 fi
118125
119126 # Set output for nightly channel
@@ -124,14 +131,15 @@ jobs:
124131 echo "::set-output name=configuration_file_name::.cortexrc-nightly"
125132 echo "::set-output name=uninstaller_file_name::cortex-nightly-uninstall.sh"
126133 echo "::set-output name=iss_file_name::installer-nightly.iss"
134+ echo "::set-output name=local_iss_file_name::local-installer-nightly.iss"
127135 fi
128136
129137 - name : Install jq
130138 uses : dcarbone/install-jq-action@v2.0.1
131139
132140 - name : Install dependencies on Windows
133141 run : |
134- choco install make pkgconfiglite ccache awscli 7zip ninja -y
142+ choco install make pkgconfiglite ccache awscli 7zip ninja wget -y
135143 dotnet tool install --global AzureSignTool
136144
137145 - name : Download ccache from s3
@@ -171,30 +179,65 @@ jobs:
171179 run : |
172180 cd engine/templates/windows
173181 sed -i "s/AppVersion=1.0/AppVersion=${{ inputs.new_version }}/g" ${{ steps.set-output-params.outputs.iss_file_name }}
182+ sed -i "s/AppVersion=1.0/AppVersion=${{ inputs.new_version }}/g" ${{ steps.set-output-params.outputs.local_iss_file_name }}
174183 cat ${{ steps.set-output-params.outputs.iss_file_name }}
175184 cp ${{ steps.set-output-params.outputs.iss_file_name }} ../../../
185+ cp ${{ steps.set-output-params.outputs.local_iss_file_name }} ../../../
176186 ls ../../../
177187
178- - name : Build Installers
188+ - name : Build network Installers
179189 shell : bash
180190 run : |
181191 cd engine
182192 make build-installer PACKAGE_NAME=${{ steps.set-output-params.outputs.package_name }} VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}"
183193 ls ../
184194
195+ - name : Build local Installers
196+ shell : powershell
197+ run : |
198+ mkdir dependencies
199+ cd dependencies
200+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx-cuda-11-7.tar.gz
201+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx-cuda-12-0.tar.gz
202+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx.tar.gz
203+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx2-cuda-11-7.tar.gz
204+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx2-cuda-12-0.tar.gz
205+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx2.tar.gz
206+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx512-cuda-11-7.tar.gz
207+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx512-cuda-12-0.tar.gz
208+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-avx512.tar.gz
209+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-noavx-cuda-11-7.tar.gz
210+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-noavx-cuda-12-0.tar.gz
211+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-noavx.tar.gz
212+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-windows-amd64-vulkan.tar.gz
213+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cuda-11-7-windows-amd64.tar.gz
214+ wget.exe https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cuda-12-0-windows-amd64.tar.gz
215+
185216 - name : Enable long paths
186217 run : |
187218 reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
188219
189- - name : Compile .ISS to .EXE Installer
220+ - name : Compile .ISS to .EXE network Installer
190221 uses : nadeemjazmawe/inno-setup-action-cli@v6.0.5
191222 with :
192223 filepath : ./${{ steps.set-output-params.outputs.iss_file_name }}
193224
194- - name : Codesign for windows installer
225+ - name : Codesign for windows network installer
226+ shell : pwsh
227+ run : |
228+ ~\.dotnet\tools\azuresigntool.exe sign -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvi ${{ secrets.AZURE_CLIENT_ID }} -kvt ${{ secrets.AZURE_TENANT_ID }} -kvs ${{ secrets.AZURE_CLIENT_SECRET }} -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\setup.exe"
229+ mv .\setup.exe .\network-setup.exe
230+
231+ - name : Compile .ISS to .EXE local Installer
232+ uses : nadeemjazmawe/inno-setup-action-cli@v6.0.5
233+ with :
234+ filepath : ./${{ steps.set-output-params.outputs.local_iss_file_name }}
235+
236+ - name : Codesign for windows network installer
195237 shell : pwsh
196238 run : |
197239 ~\.dotnet\tools\azuresigntool.exe sign -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvi ${{ secrets.AZURE_CLIENT_ID }} -kvt ${{ secrets.AZURE_TENANT_ID }} -kvs ${{ secrets.AZURE_CLIENT_SECRET }} -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\setup.exe"
240+ mv .\setup.exe .\local-setup.exe
198241
199242 - name : Package
200243 run : |
@@ -207,11 +250,17 @@ jobs:
207250 name : cortex-${{ inputs.new_version }}-windows-amd64
208251 path : ./engine/cortex
209252
210- - name : Upload Artifact
253+ - name : Upload Artifact network installer
211254 uses : actions/upload-artifact@v4
212255 with :
213- name : cortex-${{ inputs.new_version }}-windows-amd64-installer
214- path : ./setup.exe
256+ name : cortex-${{ inputs.new_version }}-windows-amd64-network-installer
257+ path : ./network-setup.exe
258+
259+ - name : Upload Artifact local installer
260+ uses : actions/upload-artifact@v4
261+ with :
262+ name : cortex-${{ inputs.new_version }}-windows-amd64-local-installer
263+ path : ./local-setup.exe
215264
216265 - name : upload to aws s3 if public provider is aws
217266 if : inputs.public_provider == 'aws-s3'
@@ -221,7 +270,8 @@ jobs:
221270 aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/windows-amd64-cortex-nightly.tar.gz
222271
223272 aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/windows-amd64/cortex-nightly.tar.gz
224- aws s3 cp ./setup.exe s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/windows-amd64/cortex-${{ inputs.new_version }}-windows-amd64-installer.exe
273+ aws s3 cp ./network-setup.exe s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/windows-amd64/cortex-${{ inputs.new_version }}-windows-amd64-network-installer.exe
274+ aws s3 cp ./local-setup.exe s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/windows-amd64/cortex-${{ inputs.new_version }}-windows-amd64-local-installer.exe
225275 env :
226276 AWS_ACCESS_KEY_ID : ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
227277 AWS_SECRET_ACCESS_KEY : ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
@@ -246,6 +296,17 @@ jobs:
246296 uses : actions/upload-release-asset@v1.0.1
247297 with :
248298 upload_url : ${{ inputs.upload_url }}
249- asset_path : ./setup.exe
250- asset_name : cortex-${{ inputs.new_version }}-windows-amd64-installer.exe
299+ asset_path : ./network-setup.exe
300+ asset_name : cortex-${{ inputs.new_version }}-windows-amd64-network-installer.exe
301+ asset_content_type : application/octet-stream
302+
303+ - name : Upload release assert if public provider is github
304+ if : inputs.public_provider == 'github'
305+ env :
306+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
307+ uses : actions/upload-release-asset@v1.0.1
308+ with :
309+ upload_url : ${{ inputs.upload_url }}
310+ asset_path : ./local-setup.exe
311+ asset_name : cortex-${{ inputs.new_version }}-windows-amd64-local-installer.exe
251312 asset_content_type : application/octet-stream
0 commit comments