-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
4,334 additions
and
573 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -37,16 +37,16 @@ jobs: | |
with: | ||
name: GITHUB_TOKEN | ||
value: ${{ github.token }} | ||
|
||
- name: Copy files | ||
shell: pwsh | ||
run: | | ||
Copy-Item -Path "src/Sidekick.Common.Blazor/wwwroot/*" -Destination "src/Sidekick.Wpf/wwwroot" -Recurse | ||
- name: .NET 7 - Setup | ||
- name: .NET - Setup | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 7.x | ||
dotnet-version: 8.x | ||
|
||
- name: .NET - Restore | ||
run: dotnet restore | ||
|
@@ -67,7 +67,7 @@ jobs: | |
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.DEPLOY_RELEASE_KEY }} | ||
|
||
- name: Run release script | ||
shell: pwsh | ||
run: | | ||
|
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,7 @@ | ||
{ | ||
"sdk": { | ||
"version": "8.0.0", | ||
"rollForward": "latestMajor", | ||
"allowPrerelease": false | ||
} | ||
} |
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Sidekick.Apis.GitHub.Api | ||
{ | ||
internal record Asset | ||
{ | ||
public string? Url { get; init; } | ||
namespace Sidekick.Apis.GitHub.Api; | ||
|
||
public string? Name { get; init; } | ||
internal record Asset | ||
{ | ||
public string? Name { get; init; } | ||
|
||
[JsonPropertyName("browser_download_url")] | ||
public string? DownloadUrl { get; init; } | ||
} | ||
[JsonPropertyName("browser_download_url")] | ||
public string? DownloadUrl { get; init; } | ||
} |
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 |
---|---|---|
@@ -1,16 +1,15 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Sidekick.Apis.GitHub.Api | ||
namespace Sidekick.Apis.GitHub.Api; | ||
|
||
internal record Release | ||
{ | ||
internal record Release | ||
{ | ||
[JsonPropertyName("tag_name")] | ||
public string? Tag { get; init; } | ||
[JsonPropertyName("tag_name")] | ||
public string? Tag { get; init; } | ||
|
||
public string? Name { get; init; } | ||
public string? Name { get; init; } | ||
|
||
public bool Prerelease { get; init; } | ||
public bool Prerelease { get; init; } | ||
|
||
public Asset[]? Assets { get; init; } | ||
} | ||
public Asset[]? Assets { get; init; } | ||
} |
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 |
---|---|---|
@@ -1,23 +1,22 @@ | ||
using Sidekick.Apis.GitHub.Models; | ||
|
||
namespace Sidekick.Apis.GitHub | ||
namespace Sidekick.Apis.GitHub; | ||
|
||
/// <summary> | ||
/// Interface to communicate with GitHub. | ||
/// </summary> | ||
public interface IGitHubClient | ||
{ | ||
/// <summary> | ||
/// Interface to communicate with GitHub. | ||
/// Gets the latest release. | ||
/// </summary> | ||
public interface IGitHubClient | ||
{ | ||
/// <summary> | ||
/// Gets the latest release. | ||
/// </summary> | ||
/// <returns>True if an update is available.</returns> | ||
Task<GitHubRelease> GetLatestRelease(); | ||
/// <returns>True if an update is available.</returns> | ||
Task<GitHubRelease> GetLatestRelease(); | ||
|
||
/// <summary> | ||
/// Downloads the latest release from github. | ||
/// </summary> | ||
/// <param name="downloadPath">The path where the file is to be downloaded.</param> | ||
/// <returns>True if the file downloaded successfully.</returns> | ||
Task<bool> DownloadLatest(string downloadPath); | ||
} | ||
/// <summary> | ||
/// Downloads the latest release from github. | ||
/// </summary> | ||
/// <param name="downloadPath">The path where the file is to be downloaded.</param> | ||
/// <returns>True if the file downloaded successfully.</returns> | ||
Task<bool> DownloadLatest(string downloadPath); | ||
} |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
namespace Sidekick.Apis.GitHub.Models | ||
namespace Sidekick.Apis.GitHub.Models; | ||
|
||
public record GitHubRelease | ||
{ | ||
public record GitHubRelease | ||
{ | ||
public bool IsNewerVersion { get; set; } | ||
public bool IsNewerVersion { get; init; } | ||
|
||
public bool IsExecutable { get; set; } | ||
} | ||
public bool IsExecutable { get; init; } | ||
} |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Sidekick.Apis.GitHub | ||
namespace Sidekick.Apis.GitHub; | ||
|
||
public static class StartupExtensions | ||
{ | ||
public static class StartupExtensions | ||
public static IServiceCollection AddSidekickGitHubApi(this IServiceCollection services) | ||
{ | ||
public static IServiceCollection AddSidekickGitHubApi(this IServiceCollection services) | ||
{ | ||
services.AddHttpClient(); | ||
services.AddTransient<IGitHubClient, GitHubClient>(); | ||
services.AddHttpClient(); | ||
services.AddTransient<IGitHubClient, GitHubClient>(); | ||
|
||
return services; | ||
} | ||
return services; | ||
} | ||
} |
Oops, something went wrong.