diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f35d69749a7b1a8d64e2f388da75a61b3023327..4c07bbde9b4343405fd34919b0f033491c580474 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,50 +9,44 @@ Windows-MSYS2-MINGW64: - tags tags: [ windows, msys2 ] script: + # Installing MSYS2 - Invoke-WebRequest -OutFile "msys2.exe" -Uri "https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe" - Get-FileHash ./msys2.exe -Algorithm SHA256 | Format-List - ./msys2.exe -y -oC:\ - $env:CHERE_INVOKING = 'yes' - $env:MSYSTEM = 'MINGW64' # https://www.msys2.org/docs/environments/ - - | - echo "Updating Path" + - | # Appending MSYS-MINGW64s Path to the Users PATH variable + Write-Output "Updating Path..." $NewPath = "C:\msys64\mingw64\bin" $CurrentPath = [System.Environment]::GetEnvironmentVariable("Path", "User") -split ";" - Write-Output "old Path: $CurrentPath" + Write-Output "Old Path: $CurrentPath" if ($CurrentPath -contains $NewPath) { - Write-Output "Path is already in the user PATH variable." + Write-Output "NewPath is already in the user PATH variable." } else { - Write-Output "Path is NOT in the user PATH variable. Updating..." + Write-Output "NewPath is NOT in the user PATH variable. Updating..." [System.Environment]::SetEnvironmentVariable("Path", "$($CurrentPath -join ';');$NewPath", "User") Write-Output "Path updated successfully!" + $CurrentPath = [System.Environment]::GetEnvironmentVariable("Path", "User") -split ";" + Write-Output "New Path: $CurrentPath" } - - | - $CurrentPath = [System.Environment]::GetEnvironmentVariable("Path", "User") -split ";" - Write-Output "new Path: $CurrentPath" + # Updating the MSYS2 Environment - C:\msys64\usr\bin\bash -lc ' ' - C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' - C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' - - | + - | # Installing the necessary Packages C:\msys64\usr\bin\bash -lcx ' pacman --noconfirm -Syu mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake pacman --noconfirm -Syu mingw-w64-x86_64-qt5-static pacman --noconfirm -Syu zip' - - | + - | # Building C:\msys64\usr\bin\bash -lcx ' mkdir -p build cd build - cmake .. -DCMAKE_BUILD_TYPE=Release - ls -lh - rm -r * cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ - ls -lh - rm -r * - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ - ls -lh cmake --build . --target cute ls -lh cd ..' - - | + - | # Collecting all Files and zipping them C:\msys64\usr\bin\bash -lcx ' mkdir -p template/{lib,src} mv build/cute.dll template/lib/ @@ -66,9 +60,12 @@ Windows-MSYS2-MINGW64: mv .gitignore template/ zip -r template-windows.zip template/ ' + # Uploading the zip to the Package Registry - $URL = "${CI_API_V4_URL}/projects/$CI_PROJECT_ID/packages/generic/cutelib-hsrt/$CI_COMMIT_TAG/template-windows.zip" - Invoke-WebRequest -Uri $URL -Method Put -Headers @{ "JOB-TOKEN" = "$CI_JOB_TOKEN" } -InFile "template-windows.zip" -UseBasicParsing +# Automatically publishing a new Release with the files Uploaded to the Package Registry. +# The Release may be edited manually under gitlab -> project -> deploy -> releases. Publish: stage: release only: