-
Notifications
You must be signed in to change notification settings - Fork 59
212 lines (180 loc) · 8.86 KB
/
WindowsGit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Windows Git
on:
push:
branches:
- master
tags-ignore:
- '*'
env:
QT5_VERSION: "5.15.2"
MINGW5_VERSION: "win32_mingw81"
MINGW5_PATH: "mingw81_32"
QT6_VERSION: "6.6.2"
MINGW6_VERSION: "win64_mingw"
MINGW6_PATH: "mingw_64"
BUILD_TYPE: Release
jobs:
WindowsGit:
runs-on: windows-latest
steps:
-
uses: actions/checkout@v4
with:
path: SiriKali
-
name: Install mingw
uses: msys2/setup-msys2@v2
with:
install: mingw-w64-i686-gcc
msystem: mingw32
location: ${{github.workspace}}
-
name: update env for Qt5
run: echo "${{github.workspace}}/msys64/mingw32/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
-
name: Check GCC version and path for Qt5
run: |
Write-Output (Get-Command c++.exe).Path
c++.exe --version
-
name: Install Qt5
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT5_VERSION }}
arch: ${{ env.MINGW5_VERSION }}
dir: "${{github.workspace}}/qt5"
install-deps: "true"
host: 'windows'
target: 'desktop'
-
name: Set Build time
run: |
$now = (Get-Date)
$then = (Get-Date -Year 2024 -Month 5 -Day 3 -Hour 0 -Minute 0)
echo "CURRENT_TIME=$($now.ToString())" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$All = (New-TimeSpan -start $then -end $now)
$Days=$All.Days.ToString()
$Hours=$All.Hours.ToString()
$Minutes=$All.Minutes.ToString()
if($Hours.Length -eq 1){ $Hours = "0" + $Hours }
if($Minutes.Length -eq 1){ $Minutes = "0" + $Minutes }
$Version=$Days+$Hours+$Minutes
$Version=$Version.TrimStart("0")
echo "GIT_VERSION_NUMBER=$Version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
-
name: Configure CMake for Qt5
env:
CMAKE_PREFIX_PATH: "${{github.workspace}}/qt5/Qt/${{ env.QT5_VERSION }}"
msystem: MINGW32
run: cmake -DOUTPUT_BASE_NAME=SiriKaliQt5 -DBUILD_WITH_QT6=false -DLIBRARIES_LOCATION=${{github.workspace}}\SiriKali.git\ -DOUTPUT_PATH=${{github.workspace}}\ -DSOURCE_PATH=${{github.workspace}}\SiriKali\ -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G "CodeBlocks - MinGW Makefiles" -S ${{github.workspace}}/SiriKali/ -B ${{github.workspace}}/SiriKali/build5
-
name: Print installer script for Qt5
run : get-content ${{github.workspace}}\SiriKali\build5\sirikali_windows_installer_Qt5.iss
-
name: Update version.h for Qt5
run: |
$content = [System.IO.File]::ReadAllText("${{github.workspace}}\SiriKali\build5\version.h").Replace("git_tag",${{ env.GIT_VERSION_NUMBER }})
[System.IO.File]::WriteAllText("${{github.workspace}}\SiriKali\build5\version.h",$content )
-
name: Build Project for Qt5
run: cmake --build ${{github.workspace}}/SiriKali/build5
-
name: Prepare release date
run: |
$data = [System.IO.File]::ReadAllText("${{github.workspace}}\SiriKali\build5\version.h")
$versionInfoLines = $data.Split([Environment]::NewLine, [System.StringSplitOptions]::RemoveEmptyEntries)
$versionInfoFirstLine = $versionInfoLines[1]
$versionInfo = $versionInfoFirstLine.Split(" ",[System.StringSplitOptions]::RemoveEmptyEntries)[2]
echo "BUILD_VERSION=$versionInfo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
-
name: Create SiriKali.git.exe.zip
run: |
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKali.git
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKali.git/local
Copy-Item -Path ${{github.workspace}}\SiriKali\translations -Destination ${{github.workspace}}\SiriKali.git -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\build5\sirikali.exe -Destination ${{github.workspace}}\SiriKali.git
Copy-Item -Path ${{github.workspace}}\SiriKali\build5\src/sirikali_cppcryptfs\sirikali_cppcryptfs.exe -Destination ${{github.workspace}}\SiriKali.git
Set-Location ${{github.workspace}}\SiriKali.git
${{github.workspace}}/qt5/Qt/${{ env.QT5_VERSION }}/${{ env.MINGW5_PATH }}/bin/windeployqt.exe ${{github.workspace}}\SiriKali.git\sirikali.exe
$bb = ${{ env.BUILD_VERSION }}
$bb = $bb.Trim()
echo "$bb" | Out-File -FilePath ${{github.workspace}}\SiriKali.git\version_info.txt -Encoding utf8 -Append
Compress-Archive -Path ${{github.workspace}}\SiriKali.git -DestinationPath ${{github.workspace}}\SiriKaliQt5.git.zip
Remove-Item -Path ${{github.workspace}}\SiriKali.git\local
Remove-Item -Path ${{github.workspace}}\SiriKali.git\version_info.txt
-
name: Make installer for Qt5
uses: Minionguyjpro/[email protected]
with:
path: SiriKali/build5/sirikali_windows_installer_Qt5.iss
-
name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT6_VERSION }}
arch: ${{ env.MINGW6_VERSION }}
dir: "${{github.workspace}}/qt6"
install-deps: "true"
host: 'windows'
target: 'desktop'
tools: 'tools_mingw1310'
-
name: update env for Qt6
run: echo "${{github.workspace}}/qt6/Qt/Tools/mingw1310_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
-
name: Check GCC version and path for Qt6
run: |
Write-Output (Get-Command c++.exe).Path
c++.exe --version
-
name: Configure CMake for Qt6
env:
CMAKE_PREFIX_PATH: "${{github.workspace}}/qt6/Qt/${{ env.QT6_VERSION }}"
msystem: MINGW32
run: cmake -DOUTPUT_BASE_NAME=SiriKaliQt6 -DLIBRARIES_LOCATION=${{github.workspace}}\SiriKaliQt6.git\ -DOUTPUT_PATH=${{github.workspace}}\ -DSOURCE_PATH=${{github.workspace}}\SiriKali\ -DBUILD_WITH_QT6=true -DCMAKE_VERBOSE_MAKEFILE=FALSE -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G "CodeBlocks - MinGW Makefiles" -S ${{github.workspace}}/SiriKali/ -B ${{github.workspace}}/SiriKali/build6
-
name: Print installer script for Qt6
run : get-content ${{github.workspace}}\SiriKali\build6\sirikali_windows_installer_Qt6.iss
-
name: Update version.h for Qt6
run: |
$content = [System.IO.File]::ReadAllText("${{github.workspace}}\SiriKali\build6\version.h").Replace("git_tag",${{ env.GIT_VERSION_NUMBER }})
[System.IO.File]::WriteAllText("${{github.workspace}}\SiriKali\build6\version.h",$content )
-
name: Build Project for Qt6
run: cmake --build ${{github.workspace}}/SiriKali/build6
-
name: Create SiriKaliQt6.git.exe.zip
run: |
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt6.git
New-Item -ItemType Directory -Path ${{github.workspace}}\SiriKaliQt6.git/local
Copy-Item -Path ${{github.workspace}}\SiriKali\translations -Destination ${{github.workspace}}\SiriKaliQt6.git -Recurse
Copy-Item -Path ${{github.workspace}}\SiriKali\build6\sirikali.exe -Destination ${{github.workspace}}\SiriKaliQt6.git
Copy-Item -Path ${{github.workspace}}\SiriKali\build6\src\sirikali_cppcryptfs\sirikali_cppcryptfs.exe -Destination ${{github.workspace}}\SiriKaliQt6.git
Set-Location ${{github.workspace}}\SiriKaliQt6.git
${{github.workspace}}/qt6/Qt/${{ env.QT6_VERSION }}/${{ env.MINGW6_PATH }}/bin/windeployqt6.exe ${{github.workspace}}\SiriKaliQt6.git\sirikali.exe
$bb = ${{ env.BUILD_VERSION }}
$bb = $bb.Trim()
echo "$bb" | Out-File -FilePath ${{github.workspace}}\SiriKaliQt6.git\version_info.txt -Encoding utf8 -Append
Compress-Archive -Path ${{github.workspace}}\SiriKaliQt6.git -DestinationPath ${{github.workspace}}\SiriKaliQt6.git.zip
Remove-Item -Path ${{github.workspace}}\SiriKaliQt6.git\local
Remove-Item -Path ${{github.workspace}}\SiriKaliQt6.git\version_info.txt
-
name: Make installer for Qt6
uses: Minionguyjpro/[email protected]
with:
path: SiriKali/build6/sirikali_windows_installer_Qt6.iss
-
name: Rename installers
run: |
Rename-Item -Path ${{github.workspace}}\SiriKaliQt5.exe -NewName ${{github.workspace}}\SiriKaliQt5.git.setup.exe
Rename-Item -Path ${{github.workspace}}\SiriKaliQt6.exe -NewName ${{github.workspace}}\SiriKaliQt6.git.setup.exe
-
name: Post Releases
uses: ncipollo/release-action@v1
with:
artifacts: ${{github.workspace}}\SiriKaliQt5.git.setup.exe,${{github.workspace}}\SiriKaliQt6.git.setup.exe,${{github.workspace}}\SiriKaliQt6.git.zip,${{github.workspace}}\SiriKaliQt5.git.zip
tag: "1.5.2"
commit: "master"
allowUpdates: true
body: "This entry is used to hold binaries build with github infrastructure.\n\nBuild date and time for git version: ${{ env.CURRENT_TIME }}"