pack_publish.yml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. name: 📦 Pack and publish
  2. run-name: 📦 Pack and publish ${{ github.sha }}
  3. #on: workflow_call
  4. on:
  5. workflow_run:
  6. workflows: [ 🔬 Test ]
  7. types: [ completed ]
  8. branches: [ master ]
  9. pull_request:
  10. branches: [ master ]
  11. types: [opened, synchronize, reopened, labeled, unlabeled]
  12. paths-ignore:
  13. - 'manual/**'
  14. - 'cmake/GetGALERA.cmake'
  15. - 'galera_packaging/**'
  16. push:
  17. branches:
  18. - manticore-*
  19. paths-ignore:
  20. - 'manual/**'
  21. - 'cmake/GetGALERA.cmake'
  22. - 'galera_packaging/**'
  23. tags:
  24. - 'release*'
  25. - 'pack_publish'
  26. # cancels the previous workflow run when a new one appears in the same branch (e.g. master or a PR's branch)
  27. concurrency:
  28. group: pack_${{ github.ref }}
  29. cancel-in-progress: true
  30. jobs:
  31. check_branch:
  32. name: Check branch existence
  33. runs-on: ubuntu-22.04
  34. outputs:
  35. columnar_locator: ${{ steps.set_locator.outputs.columnar_locator }}
  36. steps:
  37. - name: Check if branch exists in manticoresoftware/manticoresearch
  38. id: check_branch
  39. if: github.ref_name != 'master'
  40. run: |
  41. # Extract the actual branch name for pull requests
  42. if [[ "${{ github.event_name }}" == "pull_request" ]]; then
  43. BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
  44. else
  45. BRANCH_NAME="${{ github.ref_name }}"
  46. fi
  47. HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://api.github.com/repos/manticoresoftware/columnar/branches/$BRANCH_NAME)
  48. if [ "$HTTP_STATUS" -eq "200" ]; then
  49. echo "branch_exists=true" >> $GITHUB_OUTPUT
  50. echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
  51. else
  52. echo "branch_exists=false" >> $GITHUB_OUTPUT
  53. echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
  54. fi
  55. - name: Set Columnar Locator
  56. id: set_locator
  57. run: |
  58. if [[ "${{ github.ref_name }}" != "master" && "${{ steps.check_branch.outputs.branch_exists }}" == "true" ]]; then
  59. echo "columnar_locator=GIT_REPOSITORY https://github.com/manticoresoftware/columnar.git GIT_TAG ${{ steps.check_branch.outputs.branch_name }}" >> $GITHUB_OUTPUT
  60. else
  61. echo "columnar_locator=" >> $GITHUB_OUTPUT
  62. fi
  63. pack:
  64. name: OK to pack?
  65. runs-on: ubuntu-22.04
  66. outputs:
  67. version: ${{ steps.semver-tagger.outputs.version }}
  68. version_full: ${{ steps.semver-tagger.outputs.version_full }}
  69. version_rpm: ${{ steps.semver-tagger.outputs.version_rpm }}
  70. version_deb: ${{ steps.semver-tagger.outputs.version_deb }}
  71. target: ${{ steps.semver-tagger.outputs.target }}
  72. should_continue: ${{ steps.check-should-continue.outputs.should_continue }}
  73. if: |
  74. (
  75. github.event_name == 'pull_request'
  76. &&
  77. (
  78. contains(
  79. github.event.pull_request.labels.*.name, 'pack'
  80. )
  81. ||
  82. contains(
  83. github.event.pull_request.labels.*.name, 'publish'
  84. )
  85. )
  86. )
  87. ||
  88. (
  89. github.event_name == 'workflow_run'
  90. &&
  91. github.event.workflow_run.conclusion == 'success'
  92. &&
  93. github.ref == 'refs/heads/master'
  94. )
  95. ||
  96. (
  97. github.event_name == 'push'
  98. &&
  99. (
  100. startsWith(
  101. github.ref, 'refs/heads/manticore-'
  102. )
  103. ||
  104. contains(
  105. github.ref, 'refs/tags/pack_publish'
  106. )
  107. )
  108. )
  109. steps:
  110. - name: Checkout repository
  111. uses: actions/checkout@v3
  112. with:
  113. fetch-depth: 0
  114. token: ${{ secrets.GITHUB_TOKEN }}
  115. - name: Update version
  116. id: semver-tagger
  117. uses: manticoresoftware/semver-tagger-action@main
  118. with:
  119. github_token: ${{ secrets.GITHUB_TOKEN }}
  120. conventional_commits_authors: [email protected]
  121. ignore_patterns: '\.md$|^test/|^manual/|\.clt|\.github|\.patterns|\.yml|\.gitignore'
  122. - name: Check if we should continue packing
  123. id: check-should-continue
  124. run: |
  125. # Continue if version was updated, if we have the "pack" label on PR, or if target is "release"
  126. if [[ "${{ steps.semver-tagger.outputs.version_updated }}" == "true" ]]; then
  127. echo "Continuing because version was updated"
  128. echo "should_continue=true" >> $GITHUB_OUTPUT
  129. elif [[ "${{ steps.semver-tagger.outputs.target }}" == "release" ]]; then
  130. echo "Continuing because target is release"
  131. echo "should_continue=true" >> $GITHUB_OUTPUT
  132. elif [[ "${{ github.event_name }}" == "pull_request" && "${{ contains(github.event.pull_request.labels.*.name, 'pack') }}" == "true" ]]; then
  133. echo "Continuing because PR has 'pack' label"
  134. echo "should_continue=true" >> $GITHUB_OUTPUT
  135. elif [[ "${{ contains(github.ref, 'refs/tags/pack_publish') }}" == "true" ]]; then
  136. echo "Continuing because commit has 'pack_publish' tag"
  137. echo "should_continue=true" >> $GITHUB_OUTPUT
  138. else
  139. echo "Skipping packing because version wasn't updated, target is not release, and there's no 'pack' label or tag"
  140. echo "should_continue=false" >> $GITHUB_OUTPUT
  141. fi
  142. - run: |
  143. echo "# Packing and publishing all for commit ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
  144. echo "* Commit URL: [${{ github.sha }}](/${{ github.repository }}/commit/${{ github.sha }})" >> $GITHUB_STEP_SUMMARY
  145. echo "* Initiated by: [@${{ github.actor }}](https://github.com/${{ github.actor }})" >> $GITHUB_STEP_SUMMARY
  146. echo "* Ref: ${{ github.ref_type }} \"${{ github.ref_name }}\"" >> $GITHUB_STEP_SUMMARY
  147. echo "* Attempt: ${{ github.run_attempt }}" >> $GITHUB_STEP_SUMMARY
  148. echo "* Version updated: ${{ steps.semver-tagger.outputs.version_updated }}" >> $GITHUB_STEP_SUMMARY
  149. echo "* Should continue packing: ${{ steps.check-should-continue.outputs.should_continue }}" >> $GITHUB_STEP_SUMMARY
  150. # debug_info:
  151. # name: Debug GitHub Event Info
  152. # runs-on: ubuntu-22.04
  153. # steps:
  154. # - name: Print GitHub Event Info
  155. # run: |
  156. # echo "GitHub Event Name: ${{ github.event_name }}"
  157. # echo "GitHub Ref: ${{ github.ref }}"
  158. # echo "GitHub Ref Type: ${{ github.ref_type }}"
  159. # echo "GitHub Ref Name: ${{ github.ref_name }}"
  160. # echo "GitHub Actor: ${{ github.actor }}"
  161. # echo "GitHub Repository: ${{ github.repository }}"
  162. # echo "GitHub SHA: ${{ github.sha }}"
  163. # echo "GitHub Run Number: ${{ github.run_number }}"
  164. # echo "GitHub Run Attempt: ${{ github.run_attempt }}"
  165. # echo "GitHub Workflow: ${{ github.workflow }}"
  166. # echo "GitHub Event JSON:"
  167. # echo '${{ toJSON(github.event) }}'
  168. # Job to check dependencies using check_deps_in_repos.sh
  169. # Runs on every PR, workflow_run, or push event matching the conditions
  170. check_deps:
  171. needs: pack
  172. if: needs.pack.outputs.should_continue == 'true'
  173. name: Check deps test
  174. runs-on: ubuntu-22.04
  175. steps:
  176. - name: Checkout repository
  177. uses: actions/checkout@v3
  178. # We have to checkout to access .github/workflows/ in further steps
  179. - name: Run dependency check script
  180. run: |
  181. bash dist/check_deps_in_repos.sh --target ${{ needs.pack.outputs.target }}
  182. pack_debian_ubuntu:
  183. name: Debian/Ubuntu packages
  184. uses: ./.github/workflows/build_template.yml
  185. needs: [pack, check_branch, check_deps]
  186. if: needs.pack.outputs.should_continue == 'true'
  187. strategy:
  188. fail-fast: false
  189. matrix:
  190. DISTR: [bionic, focal, jammy, bullseye, bookworm]
  191. arch: [x86_64, aarch64]
  192. with:
  193. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  194. DISTR: ${{ matrix.DISTR }}
  195. arch: ${{ matrix.arch }}
  196. cmake_command: |
  197. mkdir build
  198. cd build
  199. cmake -DPACK=1 ..
  200. export CMAKE_TOOLCHAIN_FILE=$(pwd)/dist/build_dockers/cross/linux.cmake
  201. cmake --build . --target package
  202. cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }}
  203. artifact_list: "build/manticore*deb"
  204. version: ${{ needs.pack.outputs.version }}
  205. build_tag: ${{ needs.pack.outputs.target == 'dev' && 'dev' || '' }}
  206. pack_rhel:
  207. name: RHEL packages
  208. uses: ./.github/workflows/build_template.yml
  209. needs: [pack, check_branch, check_deps]
  210. if: needs.pack.outputs.should_continue == 'true'
  211. strategy:
  212. fail-fast: false
  213. matrix:
  214. DISTR: [rhel8, rhel9, rhel10]
  215. arch: [x86_64, aarch64]
  216. with:
  217. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  218. DISTR: ${{ matrix.DISTR }}
  219. arch: ${{ matrix.arch }}
  220. boost_url_key: boost_rhel_feb17
  221. cmake_command: |
  222. ln -s $(pwd) /builds_manticoresearch_dev_usr_src_debug_manticore_component_src_0_0
  223. cd /builds_manticoresearch_dev_usr_src_debug_manticore_component_src_0_0
  224. mkdir build
  225. cd build
  226. cmake -DPACK=1 ..
  227. export CMAKE_TOOLCHAIN_FILE=$(pwd)/dist/build_dockers/cross/linux.cmake
  228. cmake --build . --target package
  229. cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }}
  230. artifact_list: "build/manticore*rpm"
  231. version: ${{ needs.pack.outputs.version }}
  232. build_tag: ${{ needs.pack.outputs.target == 'dev' && 'dev' || '' }}
  233. pack_macos:
  234. name: MacOS packages
  235. uses: ./.github/workflows/build_template.yml
  236. needs: [pack, check_branch, check_deps]
  237. if: needs.pack.outputs.should_continue == 'true'
  238. strategy:
  239. fail-fast: false
  240. matrix:
  241. DISTR: [macos]
  242. arch: [x86_64, arm64]
  243. with:
  244. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  245. DISTR: ${{ matrix.DISTR }}
  246. arch: ${{ matrix.arch }}
  247. HOMEBREW_PREFIX: /opt/homebrew
  248. cmake_command: |
  249. mkdir build
  250. cd build
  251. cmake -DPACK=1 ..
  252. export CMAKE_TOOLCHAIN_FILE=$(pwd)/dist/build_dockers/cross/osx.cmake
  253. cmake --build . --target package
  254. cache_key: pack_${{ matrix.DISTR }}_${{ matrix.arch }}
  255. artifact_list: "build/manticore*tar.gz"
  256. version: ${{ needs.pack.outputs.version }}
  257. build_tag: ${{ needs.pack.outputs.target == 'dev' && 'dev' || '' }}
  258. pack_windows:
  259. name: Windows x64 package
  260. uses: ./.github/workflows/build_template.yml
  261. needs: [pack, check_branch, check_deps]
  262. if: needs.pack.outputs.should_continue == 'true'
  263. with:
  264. COLUMNAR_LOCATOR: ${{ needs.check_branch.outputs.columnar_locator }}
  265. DISTR: windows
  266. arch: x64
  267. sysroot_url_key: roots_mysql83_jan17
  268. boost_url_key: boost_80
  269. cmake_command: |
  270. mkdir build
  271. cd build
  272. cmake -DPACK=1 ..
  273. export CMAKE_TOOLCHAIN_FILE=$(pwd)/dist/build_dockers/cross/windows.cmake
  274. cmake --build . --target package
  275. cache_key: pack_windows_x64
  276. artifact_list: "build/manticore*exe build/manticore*zip"
  277. version: ${{ needs.pack.outputs.version }}
  278. build_tag: ${{ needs.pack.outputs.target == 'dev' && 'dev' || '' }}
  279. build_nsis:
  280. name: Making Windows NSIS installer
  281. needs: [pack_windows, pack]
  282. if: needs.pack.outputs.should_continue == 'true'
  283. runs-on: ubuntu-22.04
  284. container:
  285. image: manticoresearch/build_nsis:1.0.0
  286. env:
  287. CI_COMMIT_SHA: ${{ github.sha }}
  288. steps:
  289. - name: Checkout repository
  290. uses: actions/checkout@v3
  291. - name: Patch version
  292. run: |
  293. sed -i "s/0\.0\.0/${{ needs.pack.outputs.version }}/g" src/sphinxversion.h.in
  294. - name: Initialization
  295. # without adding the safe.directory the script fails to do git show ...
  296. run: git config --global --add safe.directory /__w/manticoresearch/manticoresearch
  297. - name: Make installer
  298. # TODO: remove the hardcoded paths /builds/ below
  299. run: |
  300. mkdir -p /builds/manticoresearch/dev/build/
  301. /bin/bash dist/build_dockers/nsis/nsis_src_parser.sh ${{ needs.pack.outputs.target }}
  302. shell: bash
  303. - run: mv /builds/manticoresearch/dev/build build
  304. - name: Upload artifact
  305. uses: manticoresoftware/upload_artifact_with_retries@main
  306. with:
  307. name: win_installer
  308. path: build/manticore-*.exe
  309. # virtual job to simplify the CI
  310. publish:
  311. name: OK to publish?
  312. runs-on: ubuntu-22.04
  313. # This job depends on all the package preparation jobs that have to pass before we can start publishing packages
  314. needs: [pack_debian_ubuntu, pack_rhel, pack_macos, build_nsis]
  315. if: |
  316. (github.repository == 'manticoresoftware/manticoresearch')
  317. && (
  318. (github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'publish')))
  319. || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
  320. || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/manticore-'))
  321. || (github.event_name == 'push' && contains(github.ref, 'refs/tags/pack_publish'))
  322. )
  323. steps:
  324. - run: echo "Ready to publish"
  325. publish_debian_ubuntu:
  326. needs: [publish, pack]
  327. strategy:
  328. fail-fast: true
  329. matrix:
  330. DISTR: [bionic, focal, jammy, bullseye, bookworm]
  331. arch: [x86_64, aarch64]
  332. runs-on: ubuntu-22.04
  333. name: ${{ matrix.DISTR }} ${{ matrix.arch }} publishing
  334. steps:
  335. - uses: manticoresoftware/publish_to_repo@main
  336. with:
  337. ssh_key: ${{ secrets.REPO_SSH_KEY }}
  338. distr: ${{ matrix.DISTR }}
  339. arch: ${{ matrix.arch }}
  340. artifact: build_${{ matrix.DISTR }}_RelWithDebInfo_${{ matrix.arch }}
  341. type: deb
  342. delimiter: "-"
  343. target: ${{ needs.pack.outputs.target }}
  344. publish_rhel:
  345. needs: [publish, pack]
  346. strategy:
  347. fail-fast: true
  348. matrix:
  349. DISTR: [8, 9, 10]
  350. arch: [x86_64, aarch64]
  351. runs-on: ubuntu-22.04
  352. name: RHEL ${{ matrix.DISTR }} ${{ matrix.arch }} publishing
  353. steps:
  354. - uses: manticoresoftware/publish_to_repo@main
  355. with:
  356. ssh_key: ${{ secrets.REPO_SSH_KEY }}
  357. distr: ${{ matrix.DISTR }}
  358. arch: ${{ matrix.arch }}
  359. artifact: build_rhel${{ matrix.DISTR }}_RelWithDebInfo_${{ matrix.arch }}
  360. type: rpm
  361. delimiter: "_"
  362. target: ${{ needs.pack.outputs.target }}
  363. publish_macos:
  364. name: Publishing MacOS
  365. needs: [publish, pack]
  366. strategy:
  367. fail-fast: true
  368. matrix:
  369. arch: [x86_64, arm64]
  370. runs-on: ubuntu-22.04
  371. steps:
  372. - uses: manticoresoftware/publish_to_repo@main
  373. with:
  374. ssh_key: ${{ secrets.REPO_SSH_KEY }}
  375. distr: macos
  376. arch: ${{ matrix.arch }}
  377. artifact: build_macos_RelWithDebInfo_${{ matrix.arch }}
  378. type: arc
  379. delimiter: "-"
  380. target: ${{ needs.pack.outputs.target }}
  381. publish_windows:
  382. name: Publishing Windows packages to repo.manticoresearch.com
  383. needs: [publish, pack]
  384. runs-on: ubuntu-22.04
  385. steps:
  386. - uses: manticoresoftware/publish_to_repo@main
  387. with:
  388. ssh_key: ${{ secrets.REPO_SSH_KEY }}
  389. distr: windows
  390. arch: x64
  391. artifact: build_windows_RelWithDebInfo_x64
  392. type: arc
  393. delimiter: "-"
  394. target: ${{ needs.pack.outputs.target }}
  395. # Test Windows installer without Docker/Buddy on GitHub Actions
  396. test_windows_installer:
  397. name: Test Windows NSIS installer
  398. needs: [publish_windows, pack]
  399. runs-on: windows-latest
  400. steps:
  401. - name: Download Windows installer artifact
  402. uses: actions/download-artifact@v4
  403. with:
  404. name: win_installer
  405. path: ./installer
  406. - name: Extract and Install Manticore
  407. timeout-minutes: 5
  408. run: |
  409. echo "=== EXTRACTING INSTALLER ==="
  410. tar -xf ./installer/artifact.tar -C ./installer
  411. $installer = "./installer/build/manticore-*.exe"
  412. $installerFile = Get-ChildItem $installer | Select-Object -First 1
  413. if (-not $installerFile) {
  414. echo "ERROR: Installer not found!"
  415. Get-ChildItem ./installer -Recurse
  416. exit 1
  417. }
  418. echo "=== INSTALLING MANTICORE ==="
  419. echo "Installing from: $($installerFile.FullName)"
  420. $process = Start-Process -FilePath $installerFile.FullName -ArgumentList "/S /NOEXECUTOR" -Wait -PassThru -NoNewWindow
  421. echo "Installation process exited with code: $($process.ExitCode)"
  422. # Wait for installation to complete
  423. Start-Sleep -Seconds 10
  424. shell: pwsh
  425. - name: Test Manticore Service
  426. run: |
  427. echo "=== VERIFYING INSTALLATION ==="
  428. $installPath = "C:\Program Files (x86)\Manticore"
  429. if (-not (Test-Path $installPath)) {
  430. echo "ERROR: Manticore not installed at expected path: $installPath"
  431. exit 1
  432. }
  433. echo "Manticore installed at: $installPath"
  434. $searchdPath = "$installPath\bin\searchd.exe"
  435. $indexerPath = "$installPath\bin\indexer.exe"
  436. if (-not (Test-Path $searchdPath)) {
  437. echo "ERROR: searchd.exe not found at: $searchdPath"
  438. exit 1
  439. }
  440. if (-not (Test-Path $indexerPath)) {
  441. echo "ERROR: indexer.exe not found at: $indexerPath"
  442. exit 1
  443. }
  444. echo "searchd.exe found at: $searchdPath"
  445. echo "indexer.exe found at: $indexerPath"
  446. & $searchdPath --version
  447. # Disable Buddy before starting Manticore
  448. $configPath = "$installPath\etc\manticoresearch\manticore.conf"
  449. if (Test-Path $configPath) {
  450. $config = Get-Content $configPath -Raw
  451. # Add buddy_path with empty value to disable it
  452. $config = $config -replace "(searchd\s*\{)", "`$1`n buddy_path = "
  453. Set-Content -Path $configPath -Value $config -Force
  454. }
  455. echo "=== STARTING MANTICORE SERVICE ==="
  456. Push-Location $installPath
  457. $process = Start-Process -FilePath $searchdPath -PassThru -NoNewWindow
  458. # Smart wait for daemon to be ready
  459. echo "Waiting for Manticore daemon to be ready..."
  460. $maxAttempts = 30
  461. $attempt = 0
  462. $allPortsReady = $false
  463. while ($attempt -lt $maxAttempts -and -not $allPortsReady) {
  464. Start-Sleep -Seconds 1
  465. $attempt++
  466. # Check if process is still running
  467. $manticoreProcess = Get-Process -Name "searchd" -ErrorAction SilentlyContinue
  468. if (-not $manticoreProcess) {
  469. echo "ERROR: Manticore searchd process died during startup"
  470. exit 1
  471. }
  472. # Check all three ports
  473. $port9306 = Test-NetConnection -ComputerName localhost -Port 9306 -WarningAction SilentlyContinue -InformationLevel Quiet
  474. $port9308 = Test-NetConnection -ComputerName localhost -Port 9308 -WarningAction SilentlyContinue -InformationLevel Quiet
  475. $port9312 = Test-NetConnection -ComputerName localhost -Port 9312 -WarningAction SilentlyContinue -InformationLevel Quiet
  476. if ($port9306 -and $port9308 -and $port9312) {
  477. $allPortsReady = $true
  478. echo "All ports are ready after $attempt seconds"
  479. }
  480. }
  481. if (-not $allPortsReady) {
  482. echo "ERROR: Manticore did not start properly within $maxAttempts seconds"
  483. echo "Port 9306 status: $port9306"
  484. echo "Port 9308 status: $port9308"
  485. echo "Port 9312 status: $port9312"
  486. exit 1
  487. }
  488. $manticoreProcess = Get-Process -Name "searchd" -ErrorAction SilentlyContinue
  489. echo "Manticore searchd is running (PID: $($manticoreProcess.Id))"
  490. Pop-Location
  491. echo "=== TESTING MANTICORE SERVICE WITH SIMPLE STATUS CHECKS ==="
  492. # Test 1: Check HTTP API port 9308
  493. echo "`nTest 1: Checking HTTP API (port 9308)..."
  494. try {
  495. $response = Invoke-WebRequest -Uri "http://localhost:9308/" -UseBasicParsing
  496. if ($response.StatusCode -eq 200) {
  497. echo "✓ HTTP API responds with status 200"
  498. echo "✓ Response length: $($response.Content.Length) bytes"
  499. } else {
  500. echo "ERROR: Unexpected status code: $($response.StatusCode)"
  501. exit 1
  502. }
  503. } catch {
  504. echo "ERROR: Failed to access HTTP API: $_"
  505. exit 1
  506. }
  507. # Test 2: Check Sphinx/HTTP port 9312
  508. echo "`nTest 2: Checking Sphinx/HTTP port (9312)..."
  509. try {
  510. $response = Invoke-WebRequest -Uri "http://localhost:9312/" -UseBasicParsing
  511. if ($response.StatusCode -eq 200) {
  512. echo "✓ Sphinx/HTTP port responds with status 200"
  513. # Check for expected content in response
  514. if ($response.Content -like '*"version":*') {
  515. echo "✓ Response contains version information"
  516. }
  517. } else {
  518. echo "ERROR: Unexpected status code: $($response.StatusCode)"
  519. exit 1
  520. }
  521. } catch {
  522. echo "ERROR: Failed to access port 9312: $_"
  523. exit 1
  524. }
  525. # Test 3: Verify all three ports are listening
  526. echo "`nTest 3: Verifying all service ports are listening..."
  527. $ports = @(9306, 9308, 9312)
  528. $allPortsOk = $true
  529. foreach ($port in $ports) {
  530. $connection = Test-NetConnection -ComputerName localhost -Port $port -WarningAction SilentlyContinue -InformationLevel Quiet
  531. if ($connection) {
  532. echo "✓ Port $port is listening"
  533. } else {
  534. echo "✗ Port $port is NOT listening"
  535. $allPortsOk = $false
  536. }
  537. }
  538. if (-not $allPortsOk) {
  539. echo "ERROR: Not all required ports are listening"
  540. exit 1
  541. }
  542. echo ""
  543. echo "=== ALL BASIC TESTS COMPLETED SUCCESSFULLY ==="
  544. echo "✓ Installation verified"
  545. echo "✓ Daemon is running"
  546. echo "✓ All ports (9306, 9308, 9312) are accessible"
  547. echo "✓ HTTP endpoints respond with status 200"
  548. echo "✓ Manticore service is operational"
  549. shell: pwsh
  550. publish_nsis:
  551. name: Publishing Windows NSIS installer
  552. needs: [test_windows_installer, publish, pack]
  553. runs-on: ubuntu-22.04
  554. steps:
  555. - uses: manticoresoftware/publish_to_repo@main
  556. with:
  557. ssh_key: ${{ secrets.REPO_SSH_KEY }}
  558. distr:
  559. arch:
  560. artifact: win_installer
  561. type: arc
  562. delimiter: "-"
  563. target: ${{ needs.pack.outputs.target }}
  564. build_docker:
  565. name: Building and pushing docker
  566. needs: [publish_debian_ubuntu, pack]
  567. runs-on: ubuntu-22.04
  568. env:
  569. DOCKER_USER: ${{ secrets.DOCKER_USER }}
  570. DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
  571. GHCR_USER: ${{ secrets.GHCR_USER }}
  572. GHCR_PASSWORD: ${{ secrets.GHCR_PASSWORD }}
  573. steps:
  574. - name: Checkout repository
  575. uses: actions/checkout@v3
  576. - name: Patch version
  577. run: |
  578. sed -i "s/0\.0\.0/${{ needs.pack.outputs.version }}/g" src/sphinxversion.h.in
  579. - name: Calculate short commit hash
  580. id: sha
  581. run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
  582. - name: Set up QEMU
  583. uses: docker/setup-qemu-action@v3
  584. with:
  585. image: tonistiigi/binfmt:qemu-v7.0.0-28
  586. - name: Building docker
  587. run: CI_COMMIT_SHORT_SHA=${{ steps.sha.outputs.sha_short }} /bin/bash dist/dockerhub_deploy.sh
  588. clt_rhel_dev_installation:
  589. name: Testing RHEL dev packages installation
  590. needs: publish_rhel
  591. strategy:
  592. fail-fast: false
  593. matrix:
  594. image: [ "almalinux:8", "almalinux:9", "almalinux:10", "oraclelinux:9", "amazonlinux:latest" ]
  595. runs-on: ubuntu-22.04
  596. steps:
  597. - uses: manticoresoftware/[email protected]
  598. with:
  599. image: ${{ matrix.image }}
  600. test_prefix: test/clt-tests/installation/rhel-dev-
  601. run_args: -e TELEMETRY=0
  602. clt_deb_dev_installation:
  603. name: Testing DEB dev packages installation
  604. needs: publish_debian_ubuntu
  605. strategy:
  606. fail-fast: false
  607. matrix:
  608. image: [ "ubuntu:bionic", "ubuntu:focal", "ubuntu:jammy", "debian:bullseye", "debian:bookworm" ]
  609. runs-on: ubuntu-22.04
  610. steps:
  611. - uses: manticoresoftware/[email protected]
  612. with:
  613. image: ${{ matrix.image }}
  614. test_prefix: test/clt-tests/installation/deb-dev-
  615. run_args: -e TELEMETRY=0