Skip to content

Commit 9e73ea4

Browse files
author
Mindaugas Veblauskas
committed
Merge branch 'release/3.1.0'
2 parents 1e546c8 + e90c241 commit 9e73ea4

File tree

1,699 files changed

+3601
-293900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,699 files changed

+3601
-293900
lines changed

.gitlab-ci-templates.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.test_execution_script:
2+
stage: ui-test
3+
dependencies:
4+
- build-installer
5+
tags:
6+
- e2e-tests
7+
script:
8+
- ci\test-scripts\uninstall-app.ps1
9+
- ci\test-scripts\install-the-app.ps1
10+
- dotnet build src/Tests/ProtonVPN.UI.Tests/ProtonVPN.UI.Tests.csproj --arch x64 -o src/bin
11+
- VSTest.Console.exe src\bin\ProtonVPN.UI.Tests.dll /Settings:ci/test-scripts/TestRun/test-run-settings.xml /TestCaseFilter:"Category=${CATEGORY}"
12+
- ci\test-scripts\uninstall-app.ps1
13+
except:
14+
- /^debug.*$/
15+
- release/9.9.9
16+
- master
17+
artifacts:
18+
when: always
19+
name: "result-ui"
20+
paths:
21+
- $SCREENSHOT_PATH
22+
expire_in: 1 weeks
23+
24+
.build-script:
25+
stage: build
26+
tags:
27+
- windows-dot-net
28+
script:
29+
- echo "Building native dependencies..."
30+
- 'c:\nuget\nuget.exe restore ProtonVPN.InstallActions.sln'
31+
- cmd.exe /c BuildDependencies.bat publish
32+
- echo "Downloading translations from crowdin..."
33+
- python ci\build-scripts\main.py add-commit-hash $env:CI_COMMIT_SHORT_SHA
34+
- python ci\build-scripts\main.py defaultConfig
35+
- echo "Publishing ${TYPE}..."
36+
- dotnet publish ProtonVpn.sln -c ${TYPE} -r win-x64 --self-contained
37+
- msbuild src\ProtonVPN.NativeHost\NativeHost.vcxproj /p:Configuration=Release /p:Platform=x64
38+
artifacts:
39+
expire_in: 1 day
40+
paths:
41+
- src/bin/win-x64/publish
42+
- src/ProtonVPN.NativeHost/bin
43+
variables:
44+
GIT_SUBMODULE_STRATEGY: normal

.gitlab-ci.yml

Lines changed: 33 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
include:
2-
- project: 'tpe/testmo-reporter'
3-
ref: master
4-
file: '/scenarios/testmo-multiple.yml'
5-
62
- project: 'translations/generator'
73
ref: master
84
file: '/jobs/commit-locales.gitlab-ci.yml'
95

106
- project: 'translations/generator'
117
ref: master
128
file: '/jobs/sync-crowdin.gitlab-ci.yml'
9+
10+
- local: '/.gitlab-ci-templates.yml'
1311

1412
variables:
1513
PUBLIC_REPO_URL: [email protected]:ProtonVPN/win-app.git
@@ -38,67 +36,45 @@ stages:
3836
- mirror
3937

4038
build-release:
41-
stage: build
42-
tags:
43-
- windows-dot-net
44-
script:
45-
- echo "Building native dependencies..."
46-
- 'c:\nuget\nuget.exe restore ProtonVPN.InstallActions.sln'
47-
- cmd.exe /c BuildDependencies.bat
48-
- cmd.exe /c BuildGoSrp.bat src\bin\win-x64\publish\Resources
49-
- dotnet publish src\ProtonVPN.MarkupValidator\ProtonVPN.MarkupValidator.csproj --arch x64 -c Release --no-self-contained -o src\bin
50-
- echo "Downloading translations from crowdin..."
51-
- python ci\main.py lint-languages
52-
- python ci\main.py add-commit-hash $env:CI_COMMIT_SHORT_SHA
53-
- python ci\main.py defaultConfig
54-
- echo "Publishing release..."
55-
- dotnet publish ProtonVpn.sln -c Release -r win-x64 --self-contained
56-
- msbuild src\ProtonVPN.NativeHost\NativeHost.vcxproj /p:Configuration=Release /p:Platform=x64
57-
artifacts:
58-
expire_in: 1 day
59-
paths:
60-
- src/bin/win-x64/publish
61-
- src/ProtonVPN.NativeHost/bin
39+
extends: .build-script
6240
only:
6341
- master
6442
- /^release.*$/
6543
variables:
66-
GIT_SUBMODULE_STRATEGY: normal
67-
44+
TYPE: Release
45+
6846
build-debug:
69-
stage: build
70-
tags:
71-
- windows-dot-net
72-
script:
73-
- echo "Building native dependencies..."
74-
- 'c:\nuget\nuget.exe restore ProtonVPN.InstallActions.sln'
75-
- cmd.exe /c BuildDependencies.bat
76-
- cmd.exe /c BuildGoSrp.bat src\bin\win-x64\publish\Resources
77-
- dotnet publish src\ProtonVPN.MarkupValidator\ProtonVPN.MarkupValidator.csproj --arch x64 -c Release --no-self-contained -o src\bin
78-
- echo "Downloading translations from crowdin..."
79-
- python ci\main.py lint-languages
80-
- python ci\main.py add-commit-hash $env:CI_COMMIT_SHORT_SHA
81-
- python ci\main.py defaultConfig
82-
- echo "Publishing debug..."
83-
- dotnet publish ProtonVpn.sln -c Debug -r win-x64 --self-contained
84-
- msbuild src\ProtonVPN.NativeHost\NativeHost.vcxproj /p:Configuration=Release /p:Platform=x64
85-
artifacts:
86-
expire_in: 1 day
87-
paths:
88-
- src/bin/win-x64/publish
89-
- src/ProtonVPN.NativeHost/bin
47+
extends: .build-script
9048
except:
9149
- master
9250
- /^release.*$/
9351
variables:
94-
GIT_SUBMODULE_STRATEGY: normal
52+
TYPE: Debug
53+
54+
ui-test:
55+
extends: .test_execution_script
56+
variables:
57+
CATEGORY: "UI"
58+
59+
connection-test:
60+
extends: .test_execution_script
61+
variables:
62+
CATEGORY: "Connection"
63+
64+
win-11-test:
65+
extends: .test_execution_script
66+
when: manual
67+
tags:
68+
- win11
69+
variables:
70+
CATEGORY: "Smoke"
9571

9672
tests:
9773
stage: test
9874
tags:
9975
- windows-dot-net
10076
script:
101-
- cmd.exe /c BuildGoSrp.bat src\bin\Resources
77+
- cmd.exe /c BuildDependencies.bat bin gosrponly
10278
- dotnet restore ProtonVpn.sln
10379
- dotnet build ProtonVpn.sln
10480
- coverlet src\bin --target "dotnet" --targetargs "test ProtonVpn.sln -l ""console;verbosity=normal"" --filter ""TestCategory!=UI&TestCategory!=Connection"" --no-restore --no-build" --format cobertura --output .\coverage-reports --exclude "[*.Tests*]*" --exclude "[ProtonVPN.MarkupValidator]*" --exclude "[TestTools*]*" --exclude "[*.Installers]*"
@@ -111,20 +87,17 @@ tests:
11187
path: cobertura.xml
11288
coverage: '/Total.*?([0-9]{1,3}.[0-9]{1,3})%/'
11389

114-
build-installer-for-release:
90+
build-installer:
11591
stage: build-installer
11692
tags:
11793
- windows
11894
script:
119-
- python ci\main.py update-gh-list
120-
- python ci\main.py app-installer $env:CI_COMMIT_SHORT_SHA
95+
- python ci\build-scripts\main.py update-gh-list
96+
- python ci\build-scripts\main.py app-installer $env:CI_COMMIT_SHORT_SHA
12197
artifacts:
12298
paths:
12399
- Setup/Installers/
124100
expire_in: 4 weeks
125-
only:
126-
- master
127-
- /^release.*$/
128101

129102
prepare-internal-beta-release:
130103
stage: internal-beta
@@ -133,123 +106,10 @@ prepare-internal-beta-release:
133106
when: manual
134107
script:
135108
- python -m pip install -r ci\python-libs.txt
136-
- python ci\prepare-internal-beta.py
109+
- python ci\test-scripts\prepare-internal-beta.py
137110
only:
138111
- /^release.*$/
139-
140-
build-installer-for-debug:
141-
stage: build-installer
142-
tags:
143-
- windows
144-
script:
145-
- python ci\main.py update-gh-list
146-
- python ci\main.py app-installer $env:CI_COMMIT_SHORT_SHA
147-
artifacts:
148-
paths:
149-
- Setup/Installers/
150-
expire_in: 4 weeks
151-
except:
152-
- master
153-
- /^release.*$/
154-
155-
testmo-setup:
156-
allow_failure: true
157-
stage: test-setup
158-
except:
159-
- /^debug.*$/
160-
- release/9.9.9
161-
- master
162-
variables:
163-
SOURCE: "Windows"
164-
NAME: "$CI_JOB_STARTED_AT UTC"
165-
TAGS: "$CI_COMMIT_REF_SLUG"
166112

167-
ui-test:
168-
stage: ui-test
169-
tags:
170-
- ino-setup
171-
script:
172-
- ci\uninstall-app.ps1
173-
- ci\install-the-app.ps1
174-
- dotnet build src/Tests/ProtonVPN.UI.Tests/ProtonVPN.UI.Tests.csproj --arch x64 -o src/bin
175-
- VSTest.Console.exe src\bin\ProtonVPN.UI.Tests.dll /Settings:ci/TestRun/test-run-settings.xml /TestCaseFilter:"Category=UI"
176-
- ci\uninstall-app.ps1
177-
after_script:
178-
- powershell.exe ./ci/TestRun/converter-nunit-junit.ps1
179-
except:
180-
- /^debug.*$/
181-
- release/9.9.9
182-
- master
183-
- feature/inno-setup-net6
184-
artifacts:
185-
when: always
186-
name: "result-ui"
187-
paths:
188-
- $SCREENSHOT_PATH
189-
- "results/*"
190-
expire_in: 1 weeks
191-
192-
connection-test:
193-
stage: ui-test
194-
tags:
195-
- connection_tests
196-
script:
197-
- ci\uninstall-app.ps1
198-
- ci\install-the-app.ps1
199-
- dotnet build src/Tests/ProtonVPN.UI.Tests/ProtonVPN.UI.Tests.csproj --arch x64 -o src/bin
200-
- VSTest.Console.exe src\bin\ProtonVPN.UI.Tests.dll /Settings:ci/TestRun/test-run-settings.xml /TestCaseFilter:"Category=Connection"
201-
- ci\uninstall-app.ps1
202-
after_script:
203-
- powershell.exe ./ci/TestRun/converter-nunit-junit.ps1
204-
except:
205-
- /^debug.*$/
206-
- release/9.9.9
207-
- master
208-
- feature/inno-setup-net6
209-
artifacts:
210-
when: always
211-
name: "result-ui"
212-
paths:
213-
- $SCREENSHOT_PATH
214-
- "results/*"
215-
expire_in: 1 weeks
216-
217-
win-11-test:
218-
stage: ui-test
219-
when: manual
220-
tags:
221-
- win11
222-
script:
223-
- ci\uninstall-app.ps1
224-
- ci\install-the-app.ps1
225-
- dotnet build src/Tests/ProtonVPN.UI.Tests/ProtonVPN.UI.Tests.csproj --arch x64 -o src/bin
226-
- dotnet publish src\Tests\TestTools.ProfileCleaner\TestTools.ProfileCleaner.csproj --arch x64 -c Release --self-contained --verbosity q -o src\bin
227-
- VSTest.Console.exe src\bin\ProtonVPN.UI.Tests.dll /Settings:ci/TestRun/test-run-settings.xml /TestCaseFilter:"Category=Smoke"
228-
- ci\uninstall-app.ps1
229-
after_script:
230-
- powershell.exe ./ci/TestRun/converter-nunit-junit.ps1
231-
except:
232-
- /^debug.*$/
233-
- release/9.9.9
234-
- master
235-
artifacts:
236-
when: always
237-
name: "result-ui"
238-
paths:
239-
- $SCREENSHOT_PATH
240-
- "results/*"
241-
expire_in: 1 weeks
242-
243-
testmo-upload:
244-
allow_failure: true
245-
stage: test-upload
246-
except:
247-
- /^debug.*$/
248-
- release/9.9.9
249-
- master
250-
variables:
251-
RESULT_FOLDER: "results/*.xml"
252-
253113
mirror:
254114
stage: mirror
255115
tags:
@@ -259,7 +119,7 @@ mirror:
259119
- tags
260120
- master
261121
script:
262-
- python ci\main.py prepare-ssh $env:SSH_PRIVATE_KEY
122+
- python ci\build-scripts\main.py prepare-ssh $env:SSH_PRIVATE_KEY
263123
- ssh-keyscan -t rsa github.com | Set-Content "$env:userprofile\.ssh\known_hosts"
264124
- git clone "$CI_REPOSITORY_URL" --branch master _APP_CLONE;
265125
- cd _APP_CLONE
@@ -298,7 +158,7 @@ create-release:
298158
- develop-v2
299159
script:
300160
- apt-get update && apt-get install -y python3 python3-pip git
301-
- python3 ci/release.py
161+
- python3 ci/build-scripts/release.py
302162

303163
send-slack-notification:
304164
tags:
@@ -309,4 +169,4 @@ send-slack-notification:
309169
stage: publish-to-slack
310170
script:
311171
- python -m pip install -r ci\python-libs.txt
312-
- python ci\main.py send-slack-notification
172+
- python ci\build-scripts\main.py send-slack-notification

BuildDependencies.bat

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,46 @@
1-
set outputDir=..\bin\win-x64\publish\Resources\
2-
set platformToolset=v143
3-
set GOARCH=amd64
4-
5-
msbuild src\ProtonVPN.IpFilter\ProtonVPN.IpFilter.vcxproj /p:PlatformToolset=%platformToolset% /p:Platform=x64 /p:Configuration=Release /p:OutDir=%outputDir%
6-
msbuild src\ProtonVPN.NetworkUtil\ProtonVPN.NetworkUtil.vcxproj /p:PlatformToolset=%platformToolset% /p:Platform=x64 /p:Configuration=Release /p:OutDir=%outputDir%
7-
msbuild src\ProtonVPN.InstallActions\ProtonVPN.InstallActions.vcxproj /p:PlatformToolset=%platformToolset% /p:Platform=Win32 /p:Configuration=Release /p:OutDir=%outputDir%..\
8-
msbuild src\ProtonVPN.InstallActions\ProtonVPN.InstallActions.vcxproj /p:PlatformToolset=%platformToolset% /p:Platform=x64 /p:Configuration=Release /p:OutDir=%outputDir%..\
9-
10-
::LocalAgent.dll
11-
pushd %~dp0\src\ProtonVPN.LocalAgent\localAgentWin
12-
set GOOS=windows
13-
set GO111MODULE=off
14-
set CGO_CFLAGS=-O3 -Wall -Wno-unused-function -Wno-switch -std=gnu11 -DWINVER=0x0601
15-
set CC=x86_64-w64-mingw32-gcc
16-
go build -buildmode c-shared -ldflags="-w -s" -trimpath -v -o "..\..\bin\win-x64\publish\Resources\LocalAgent.dll" || exit /b 1
1+
@echo off
2+
3+
set currentDir=%~dp0
4+
set publishDir=%currentDir%src\bin\win-x64\publish\
5+
set binDir=%currentDir%src\bin\
6+
set resourcesDir=%binDir%Resources
7+
8+
if "%~1"=="publish" (
9+
set resourcesDir=%publishDir%Resources
10+
)
11+
12+
set buildParams=/p:PlatformToolset=v143 /p:Configuration=Release /p:OutDir=%resourcesDir% /clp:ErrorsOnly
13+
set x86buildParams=%buildParams% /p:Platform=Win32
14+
set x64buildParams=%buildParams% /p:Platform=x64
15+
16+
if "%~2" NEQ "gosrponly" (
17+
echo compiling ProtonVPN.IPFilter.dll
18+
msbuild src\ProtonVPN.IpFilter\ProtonVPN.IpFilter.vcxproj %x64buildParams% || exit /b %ERRORLEVEL%
19+
20+
echo compiling ProtonVPN.NetworkUtil.dll
21+
msbuild src\ProtonVPN.NetworkUtil\ProtonVPN.NetworkUtil.vcxproj %x64buildParams% || exit /b %ERRORLEVEL%
22+
23+
echo compiling ProtonVPN.InstallActions.x86.dll
24+
msbuild src\ProtonVPN.InstallActions\ProtonVPN.InstallActions.vcxproj %x86buildParams% || exit /b %ERRORLEVEL%
25+
26+
echo compiling ProtonVPN.InstallActions.dll
27+
msbuild src\ProtonVPN.InstallActions\ProtonVPN.InstallActions.vcxproj %x64buildParams% || exit /b %ERRORLEVEL%
28+
29+
echo compiling LocalAgent.dll
30+
pushd %currentDir%src\ProtonVPN.LocalAgent\localAgentWin
31+
set GO111MODULE=off
32+
set CGO_CFLAGS=-O3 -Wall -Wno-unused-function -Wno-switch -std=gnu11 -DWINVER=0x0601
33+
34+
go build -buildmode c-shared -ldflags="-w -s" -trimpath -v -o %resourcesDir%\LocalAgent.dll
35+
if %ERRORLEVEL% equ 0 (
36+
echo file saved %resourcesDir%\LocalAgent.dll
37+
)
38+
)
39+
40+
echo compiling GoSrp.dll
41+
pushd %currentDir%src\srp\windows\cshared
42+
set GO111MODULE=on
43+
go build -buildmode=c-shared -v -ldflags="-s -w" -o %resourcesDir%\GoSrp.dll main.go
44+
if %ERRORLEVEL% equ 0 (
45+
echo file saved %resourcesDir%\GoSrp.dll
46+
)

0 commit comments

Comments
 (0)