-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from mateuszskoczek/features/github_actions
Features/GitHub actions
- Loading branch information
Showing
47 changed files
with
724 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Build and publish application on master push | ||
|
||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
- "features/github_actions" | ||
#paths: | ||
#- "VDownload**" | ||
|
||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: windows-latest | ||
env: | ||
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.com | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup GitVersion | ||
uses: gittools/actions/gitversion/setup@v0.9.7 | ||
with: | ||
versionSpec: 5.x | ||
- name: Determine Version | ||
uses: gittools/actions/gitversion/execute@v0.9.7 | ||
id: gitversion | ||
with: | ||
useConfigFile: true | ||
configFilePath: .github/config/gitversion.yml | ||
- name: Set version in VDownload.csproj file | ||
id: package_version | ||
uses: KageKirin/set-csproj-version@v0 | ||
with: | ||
file: VDownload/VDownload.csproj | ||
version: ${{steps.gitversion.outputs.SemVer}} | ||
- name: Set version in Package.appxmanifest file | ||
uses: Nambers/ReplaceStringInFile@v1.3 | ||
with: | ||
path: VDownload/Package.appxmanifest | ||
oldString: 0\.0\.0\.0 | ||
newString: ${{steps.gitversion.outputs.SemVer}}.0 | ||
showFileContent: true | ||
escapeBackslash: true | ||
- name: Set version in app.manifest file | ||
uses: Nambers/ReplaceStringInFile@v1.3 | ||
with: | ||
path: VDownload/app.manifest | ||
oldString: 0\.0\.0\.0 | ||
newString: ${{steps.gitversion.outputs.SemVer}}.0 | ||
showFileContent: true | ||
escapeBackslash: true | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 8.0.x | ||
- name: Build application | ||
run: dotnet build -o build | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build | ||
path: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using Windows.ApplicationModel.Resources; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.IO; | ||
|
||
namespace VDownload.Core.Strings | ||
{ | ||
public class StringResource | ||
{ | ||
#region FIELDS | ||
|
||
protected ResourceLoader _resourceLoader; | ||
|
||
#endregion | ||
|
||
|
||
|
||
#region CONSTRUCTORS | ||
|
||
internal StringResource(ResourceLoader resourceLoader) | ||
{ | ||
_resourceLoader = resourceLoader; | ||
} | ||
|
||
#endregion | ||
|
||
|
||
|
||
#region PUBLIC METHODS | ||
|
||
public string Get(string key) | ||
{ | ||
return _resourceLoader.GetString(key); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
VDownload.Core/VDownload.Core.Strings/StringResourcesManager.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using Microsoft.UI.Xaml; | ||
using Windows.ApplicationModel.Resources; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.IO; | ||
|
||
namespace VDownload.Core.Strings | ||
{ | ||
public static class StringResourcesManager | ||
{ | ||
#region PROPERTIES | ||
|
||
public static StringResource BaseView { get; } = BuildResource("BaseViewResources"); | ||
public static StringResource HomeView { get; } = BuildResource("HomeViewResources"); | ||
public static StringResource HomeVideoView { get; } = BuildResource("HomeVideoViewResources"); | ||
public static StringResource HomeVideoCollectionView { get; } = BuildResource("HomeVideoCollectionViewResources"); | ||
public static StringResource HomeDownloadsView { get; } = BuildResource("HomeDownloadsViewResources"); | ||
public static StringResource AuthenticationView { get; } = BuildResource("AuthenticationViewResources"); | ||
public static StringResource Notifications { get; } = BuildResource("NotificationsResources"); | ||
public static StringResource Search { get; } = BuildResource("SearchResources"); | ||
public static StringResource Common { get; } = BuildResource("CommonResources"); | ||
public static StringResource DialogButtons { get; } = BuildResource("DialogButtonsResources"); | ||
public static StringResource SettingsView { get; } = BuildResource("SettingsViewResources"); | ||
public static StringResource FilenameTemplate { get; } = BuildResource("FilenameTemplateResources"); | ||
public static StringResource AboutView { get; } = BuildResource("AboutViewResources"); | ||
public static StringResource SubscriptionsView { get; } = BuildResource("SubscriptionsViewResources"); | ||
|
||
#endregion | ||
|
||
|
||
|
||
#region PRIVATE METHODS | ||
|
||
private static StringResource BuildResource(string resourceName) | ||
{ | ||
File.AppendAllText("C:\\Users\\mateusz\\Desktop\\test.txt", $"teststring {resourceName}\n"); | ||
ResourceLoader loader; | ||
try | ||
{ | ||
loader = new ResourceLoader($"VDownload.Core.Strings/{resourceName}"); | ||
File.AppendAllText("C:\\Users\\mateusz\\Desktop\\test.txt", $"afterteststring {resourceName}\n"); | ||
} | ||
catch (Exception e) | ||
{ | ||
|
||
File.AppendAllText("C:\\Users\\mateusz\\Desktop\\test.txt", $"teststringerror {e.Message}\n"); | ||
throw; | ||
} | ||
return new StringResource(loader); | ||
} | ||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.