Skip to content

Commit 2a7efc9

Browse files
Merge branch 'release/1.24.2'
2 parents 67ae811 + 0d94f67 commit 2a7efc9

32 files changed

+200
-33
lines changed

.gitlab-ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ variables:
22
PUBLIC_REPO_URL: [email protected]:ProtonVPN/win-app.git
33

44
stages:
5+
- release
56
- bot # comes from translations/generator job
67
- build
78
- test
@@ -179,3 +180,14 @@ i18n-manual-sync-crowdin:
179180
variables:
180181
I18N_SYNC_CROWDIN_PROJECT: 'windows-vpn'
181182
extends: .i18n-sync-crowdin-common
183+
184+
create-release:
185+
image: debian:stable-slim
186+
stage: release
187+
when: manual
188+
only:
189+
refs:
190+
- develop
191+
script:
192+
- apt-get update && apt-get install -y python3 python3-pip git
193+
- python3 ci/release.py

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/ProtonMail/go-srp
44
[submodule "src/ProtonVPN.LocalAgent"]
55
path = src/ProtonVPN.LocalAgent
6-
url = https://gitlab.protontech.ch/ProtonVPN/development/clients-shared.git
6+
url = https://github.com/ProtonVPN/go-vpn-lib.git

Setup/ProtonVPN.aip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@
282282
<ROW File="LocalAgent.dll" Component_="LocalAgent.dll" FileName="LOCALA~1.DLL|LocalAgent.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\Resources\32-bit\LocalAgent.dll" SelfReg="false"/>
283283
<ROW File="LocalAgent.dll_1" Component_="LocalAgent.dll_1" FileName="LOCALA~1.DLL|LocalAgent.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\Resources\64-bit\LocalAgent.dll" SelfReg="false"/>
284284
<ROW File="log4net.dll" Component_="log4net.dll" FileName="log4net.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\log4net.dll" SelfReg="false"/>
285-
<ROW File="wireguard.dll" Component_="wireguard.dll" FileName="WIREGU~1.DLL|wireguard.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="wireguard-nt\amd64\wireguard.dll" SelfReg="false"/>
286-
<ROW File="wireguard.dll_1" Component_="wireguard.dll_1" FileName="WIREGU~1.DLL|wireguard.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="wireguard-nt\x86\wireguard.dll" SelfReg="false"/>
285+
<ROW File="wireguard.dll" Component_="wireguard.dll" FileName="WIREGU~1.DLL|wireguard.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\ProtonVPN.Vpn\Resources\64-bit\wireguard.dll" SelfReg="false"/>
286+
<ROW File="wireguard.dll_1" Component_="wireguard.dll_1" FileName="WIREGU~1.DLL|wireguard.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\ProtonVPN.Vpn\Resources\32-bit\wireguard.dll" SelfReg="false"/>
287287
<ROW File="ProtonVPN.WireGuardDriver.dll" Component_="ProtonVPN.WireGuardDriver.dll" FileName="PROTO~13.DLL|ProtonVPN.WireGuardDriver.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\src\bin\ProtonVPN.WireGuardDriver.dll" SelfReg="false"/>
288288
</COMPONENT>
289289
<COMPONENT cid="caphyon.advinst.msicomp.AiRemoveFileComponent">

ci/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import tests
99
import installer
1010
import ssh
11-
import os
1211
import guest_hole_server_loader
1312
from pathlib import Path
1413

@@ -99,4 +98,4 @@
9998

10099
elif args.command == 'update-gh-list':
101100
print('Executing guest hole server loader')
102-
guest_hole_server_loader.load()
101+
guest_hole_server_loader.load()

ci/release.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import os
2+
import re
3+
4+
def get_remote_url():
5+
repository = os.getenv("CI_REPOSITORY_URL", "")
6+
user = f"git:{os.getenv('RELEASE_PAT')}"
7+
(_, url) = repository.split("@")
8+
return f"https://{user}@{url.replace(':', '/')}"
9+
10+
def configure_git(git_email, git_username):
11+
os.system(f"git config user.email \"{git_email}\"")
12+
os.system(f"git config user.name \"{git_username}\"")
13+
14+
def checkout_develop():
15+
os.system("git fetch origin develop:develop")
16+
os.system("git checkout develop")
17+
os.system(f"git remote set-url origin {get_remote_url()}")
18+
19+
def checkout_branch(name):
20+
os.system(f"git checkout -b {name}")
21+
22+
def push_branch(name):
23+
os.system(f"git push --set-upstream origin {name}")
24+
25+
def create_commit(message):
26+
os.system(f"git commit -m \"{message}\"")
27+
28+
def create_debug_branch(version):
29+
branch = f"debug/{version}"
30+
checkout_branch(branch)
31+
push_branch(branch)
32+
33+
def create_release_branch(version, commit_message):
34+
checkout_develop()
35+
branch = f"release/{version}"
36+
checkout_branch(branch)
37+
update_app_version(version)
38+
create_commit(commit_message)
39+
push_branch(branch)
40+
41+
def create_release_and_debug_branches(version):
42+
create_release_branch(version, f"Increase app version to {version}")
43+
create_debug_branch(version)
44+
45+
def update_app_version(version):
46+
file_path = 'src/GlobalAssemblyInfo.cs'
47+
content = ''
48+
with open(file_path, encoding='latin') as f:
49+
content = f.read()
50+
content = re.sub(r"(AssemblyVersion\(\")([0-9]+\.[0-9]+\.[0-9]+)", rf"\g<1>{version}", content)
51+
content = re.sub(r"(AssemblyFileVersion\(\")([0-9]+\.[0-9]+\.[0-9]+)", rf"\g<1>{version}", content)
52+
with open(file_path, 'w') as f:
53+
f.write(content)
54+
55+
os.system(f"git add {file_path}")
56+
57+
version = os.getenv('APP_VERSION')
58+
if version == None:
59+
raise Exception("Missing env variable APP_VERSION")
60+
61+
configure_git(os.getenv('RELEASE_GIT_EMAIL'), os.getenv('RELEASE_GIT_USERNAME'))
62+
63+
create_release_and_debug_branches(version)
64+
create_release_branch('9.9.9', f"Build app version 9.9.9 to test {version} installer")

src/GlobalAssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("")]
1111
[assembly: AssemblyProduct("ProtonVPN")]
12-
[assembly: AssemblyCopyright("Copyright © 2021 Proton Technologies AG")]
12+
[assembly: AssemblyCopyright("Copyright © 2021 Proton Technologies AG")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

16-
[assembly: AssemblyVersion("1.24.1.0")]
17-
[assembly: AssemblyFileVersion("1.24.1.0")]
16+
[assembly: AssemblyVersion("1.24.2.0")]
17+
[assembly: AssemblyFileVersion("1.24.2.0")]
1818
[assembly: ComVisible(false)]
1919
[assembly: AssemblyInformationalVersion("$AssemblyVersion")]

src/ProtonVPN.App/Streaming/StreamingServices.cs

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace ProtonVPN.Streaming
2626
{
2727
internal class StreamingServices : IStreamingServices
2828
{
29+
private const string COUNTRY_CODE_ANY = "*";
2930
private StreamingServicesResponse _response;
3031
private readonly IAppSettings _appSettings;
3132

@@ -37,18 +38,52 @@ public StreamingServices(StreamingServicesUpdater streamingServicesUpdater, IApp
3738

3839
public IReadOnlyList<StreamingService> GetServices(string countryCode, sbyte tier)
3940
{
40-
if (_response == null ||
41-
!_response.StreamingServices.ContainsKey(countryCode) ||
42-
!_response.StreamingServices[countryCode].ContainsKey(tier))
41+
if (_response == null)
4342
{
4443
return new List<StreamingService>();
4544
}
4645

47-
IReadOnlyList<StreamingServiceResponse> services = _response.StreamingServices[countryCode][tier];
46+
Dictionary<string, StreamingService> streamingServicesByName = new();
47+
if (IsStreamingServicesResponseContainingCountryCodeAndTier(countryCode, tier))
48+
{
49+
UpsertStreamingServicesToDictionary(streamingServicesByName, _response.StreamingServices[countryCode][tier]);
50+
}
51+
if (IsStreamingServicesResponseContainingCountryCodeAndTier(COUNTRY_CODE_ANY, tier))
52+
{
53+
UpsertStreamingServicesToDictionary(streamingServicesByName, _response.StreamingServices[COUNTRY_CODE_ANY][tier]);
54+
}
55+
56+
return streamingServicesByName.Values.OrderBy(s => s.Name).ToList();
57+
}
58+
59+
private bool IsStreamingServicesResponseContainingCountryCodeAndTier(string countryCode, sbyte tier)
60+
{
61+
return countryCode != null &&
62+
_response.StreamingServices.ContainsKey(countryCode) &&
63+
_response.StreamingServices[countryCode].ContainsKey(tier);
64+
}
4865

49-
return services.Select(s => new StreamingService(s.Name, GetIconUrl(s.Icon)))
50-
.OrderBy(s => s.Name)
51-
.ToList();
66+
private void UpsertStreamingServicesToDictionary(Dictionary<string, StreamingService> streamingServicesByName,
67+
IList<StreamingServiceResponse> streamingServiceResponses)
68+
{
69+
foreach (StreamingServiceResponse streamingServiceResponse in streamingServiceResponses)
70+
{
71+
UpsertStreamingServiceToDictionary(streamingServicesByName, streamingServiceResponse);
72+
}
73+
}
74+
75+
private void UpsertStreamingServiceToDictionary(Dictionary<string, StreamingService> streamingServicesByName,
76+
StreamingServiceResponse streamingServiceResponse)
77+
{
78+
StreamingService streamingService = MapStreamingService(streamingServiceResponse);
79+
streamingServicesByName[streamingService.Name] = streamingService;
80+
}
81+
82+
private StreamingService MapStreamingService(StreamingServiceResponse streamingServicesResponse)
83+
{
84+
return new StreamingService(
85+
name: streamingServicesResponse.Name,
86+
iconUrl: GetIconUrl(streamingServicesResponse.Icon));
5287
}
5388

5489
private string GetIconUrl(string icon)

src/ProtonVPN.Common/Configuration/Source/DefaultConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public Config Value()
144144

145145
ServerLoadUpdateInterval = TimeSpan.FromMinutes(15),
146146

147-
P2PCheckInterval = TimeSpan.FromSeconds(30),
147+
P2PCheckInterval = TimeSpan.FromSeconds(60),
148148

149149
VpnInfoCheckInterval = TimeSpan.FromMinutes(3),
150150

src/ProtonVPN.LocalAgent

src/ProtonVPN.Resources/Properties/Strings.Designer.cs

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)