Skip to content
Snippets Groups Projects
Commit 98e526aa authored by tobiglaser's avatar tobiglaser
Browse files

commented and cleaned up gitlab-ci

parent 0c145e21
No related branches found
No related tags found
No related merge requests found
...@@ -9,50 +9,44 @@ Windows-MSYS2-MINGW64: ...@@ -9,50 +9,44 @@ Windows-MSYS2-MINGW64:
- tags - tags
tags: [ windows, msys2 ] tags: [ windows, msys2 ]
script: 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" - 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 - Get-FileHash ./msys2.exe -Algorithm SHA256 | Format-List
- ./msys2.exe -y -oC:\ - ./msys2.exe -y -oC:\
- $env:CHERE_INVOKING = 'yes' - $env:CHERE_INVOKING = 'yes'
- $env:MSYSTEM = 'MINGW64' # https://www.msys2.org/docs/environments/ - $env:MSYSTEM = 'MINGW64' # https://www.msys2.org/docs/environments/
- | - | # Appending MSYS-MINGW64s Path to the Users PATH variable
echo "Updating Path" Write-Output "Updating Path..."
$NewPath = "C:\msys64\mingw64\bin" $NewPath = "C:\msys64\mingw64\bin"
$CurrentPath = [System.Environment]::GetEnvironmentVariable("Path", "User") -split ";" $CurrentPath = [System.Environment]::GetEnvironmentVariable("Path", "User") -split ";"
Write-Output "old Path: $CurrentPath" Write-Output "Old Path: $CurrentPath"
if ($CurrentPath -contains $NewPath) { 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 { } 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") [System.Environment]::SetEnvironmentVariable("Path", "$($CurrentPath -join ';');$NewPath", "User")
Write-Output "Path updated successfully!" Write-Output "Path updated successfully!"
$CurrentPath = [System.Environment]::GetEnvironmentVariable("Path", "User") -split ";"
Write-Output "New Path: $CurrentPath"
} }
- | # Updating the MSYS2 Environment
$CurrentPath = [System.Environment]::GetEnvironmentVariable("Path", "User") -split ";"
Write-Output "new Path: $CurrentPath"
- C:\msys64\usr\bin\bash -lc ' ' - C:\msys64\usr\bin\bash -lc ' '
- C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' - C:\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu'
- 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 ' 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-gcc mingw-w64-x86_64-cmake
pacman --noconfirm -Syu mingw-w64-x86_64-qt5-static pacman --noconfirm -Syu mingw-w64-x86_64-qt5-static
pacman --noconfirm -Syu zip' pacman --noconfirm -Syu zip'
- | - | # Building
C:\msys64\usr\bin\bash -lcx ' C:\msys64\usr\bin\bash -lcx '
mkdir -p build mkdir -p build
cd 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++ 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 cmake --build . --target cute
ls -lh ls -lh
cd ..' cd ..'
- | - | # Collecting all Files and zipping them
C:\msys64\usr\bin\bash -lcx ' C:\msys64\usr\bin\bash -lcx '
mkdir -p template/{lib,src} mkdir -p template/{lib,src}
mv build/cute.dll template/lib/ mv build/cute.dll template/lib/
...@@ -66,9 +60,12 @@ Windows-MSYS2-MINGW64: ...@@ -66,9 +60,12 @@ Windows-MSYS2-MINGW64:
mv .gitignore template/ mv .gitignore template/
zip -r template-windows.zip 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" - $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 - 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: Publish:
stage: release stage: release
only: only:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment