-
-
Notifications
You must be signed in to change notification settings - Fork 27
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 #273 from Somfic/dev
- Loading branch information
Showing
12 changed files
with
757 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,21 +34,22 @@ jobs: | |
path: reports/*.trx | ||
reporter: dotnet-trx | ||
|
||
semver: | ||
name: semver | ||
release: | ||
name: release | ||
needs: test | ||
runs-on: ubuntu-latest | ||
outputs: | ||
label: ${{steps.VERSION.outputs.label}} | ||
semver: ${{steps.VERSION.outputs.semver}} | ||
nuget: ${{steps.VERSION.outputs.nuget}} | ||
prerelease: ${{steps.VERSION.outputs.prerelease}} | ||
applicable: ${{steps.VERSION.outputs.applicable}} | ||
previous: ${{steps.LAST.outputs.tag}} | ||
if: github.event_name == 'push' | ||
env: | ||
nuget_key: ${{ secrets.NUGET_KEY }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
|
||
- name: Setup .NET 7 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: "7.0.x" | ||
|
||
- name: Setup GitVersion | ||
run: dotnet tool install --global GitVersion.Tool | ||
|
||
|
@@ -65,23 +66,34 @@ jobs: | |
|
||
- name: Update version | ||
run: dotnet-gitversion /updateprojectfiles /updateassemblyinfo /output buildserver | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release | ||
|
||
- name: Set job output | ||
id: VERSION | ||
run: | | ||
echo '::set-output name=label::${{env.GitVersion_PreReleaseLabel}}' | ||
echo '::set-output name=semver::${{env.GitVersion_LegacySemVer}}' | ||
echo '::set-output name=nuget::${{env.GitVersion_NuGetPreReleaseTagV2}}' | ||
echo '::set-output name=prerelease::${{env.GitVersion_PreReleaseLabel == 'alpha' || env.GitVersion_PreReleaseLabel == 'beta' }}' | ||
echo '::set-output name=applicable::${{github.ref == 'refs/heads/main' || env.GitVersion_PreReleaseLabel == 'alpha' || env.GitVersion_PreReleaseLabel == 'beta'}}' | ||
- name: Pack | ||
if: ${{env.nuget_key != ''}} | ||
run: dotnet pack --configuration Release --output nupkgs --include-symbols --include-source | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
tag_name: ${{ env.GitVersion_LegacySemVer }} | ||
name: v${{ env.GitVersion_LegacySemVer }} | ||
prerelease: ${{ env.GitVersion_PreReleaseLabel == 'alpha' || env.GitVersion_PreReleaseLabel == 'beta' }} | ||
|
||
- name: Publish project to NuGet | ||
if: ${{env.nuget_key != ''}} | ||
run: dotnet nuget push '**/*.nupkg' -k ${{ env.nuget_key }} -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
|
||
- name: Push version bump | ||
if: ${{env.GitVersion_PreReleaseLabel == '' || env.GitVersion_PreReleaseLabel == 'alpha' || env.GitVersion_PreReleaseLabel == 'beta'}} | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
author_name: github-actions[bot] | ||
author_email: github-actions[bot]@users.noreply.github.com | ||
message: "Bumped version to ${{env.GitVersion_LegacySemVer}}" | ||
message: "Bumped version to ${{ env.GitVersion_LegacySemVer }}" | ||
|
||
approve: | ||
name: approve | ||
|
@@ -93,56 +105,4 @@ jobs: | |
uses: juliangruber/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
number: ${{ github.event.number }} | ||
|
||
release: | ||
name: release | ||
needs: semver | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
env: | ||
nuget_key: ${{ secrets.NUGET_KEY }} | ||
steps: | ||
- name: Setup Ruby v3 | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "3.0" | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
tag_name: ${{needs.semver.outputs.semver}} | ||
name: v${{needs.semver.outputs.semver}} | ||
prerelease: ${{needs.semver.outputs.prerelease}} | ||
|
||
publish: | ||
name: publish | ||
needs: semver | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' && needs.semver.outputs.applicable == 'true' | ||
env: | ||
nuget_key: ${{ secrets.NUGET_KEY }} | ||
steps: | ||
- name: Checkout code | ||
if: ${{env.nuget_key != ''}} | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET 7 | ||
if: ${{env.nuget_key != ''}} | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: "7.0.x" | ||
|
||
- name: Restore dependencies | ||
if: ${{env.nuget_key != ''}} | ||
run: dotnet restore | ||
|
||
- name: Pack | ||
if: ${{env.nuget_key != ''}} | ||
run: dotnet pack --configuration Release --output nupkgs --include-symbols --include-source | ||
|
||
- name: Publish project to NuGet | ||
if: ${{env.nuget_key != ''}} | ||
run: dotnet nuget push '**/*.nupkg' -k ${{env.nuget_key}} -s https://api.nuget.org/v3/index.json --skip-duplicate | ||
number: ${{ github.event.number }} |
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,3 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=search_005Crequests_005Cbodies/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=search_005Crequests_005Cbodies_005Cfilters/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
42 changes: 42 additions & 0 deletions
42
EliteAPI.Web.Spansh/Search/Requests/Bodies/BodiesRequest.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,42 @@ | ||
using System.Runtime.Serialization; | ||
using EliteAPI.Web.Models; | ||
using EliteAPI.Web.Spansh.Search.Requests.Sort; | ||
using Newtonsoft.Json; | ||
|
||
namespace EliteAPI.Web.Spansh.Search.Requests; | ||
|
||
public class BodiesRequest : IWebApiRequest | ||
{ | ||
[JsonProperty("filters")] | ||
public FilterOptions Filters { get; init; } = new(); | ||
|
||
[JsonProperty("sort")] | ||
public ICollection<SortOption> Sorting { get; init; } = new List<SortOption> { new() }.ToArray(); | ||
|
||
[JsonProperty("reference_system")] | ||
public string ReferenceSystem { get; init; } = "Sol"; | ||
|
||
[JsonProperty("size")] | ||
public long Size { get; init; } = 50; | ||
|
||
[JsonProperty("page")] | ||
public long Page { get; init; } = 0; | ||
|
||
public class FilterOptions | ||
{ | ||
[JsonProperty("atmosphere", NullValueHandling = NullValueHandling.Ignore)] | ||
public AtmosphereFilter? Atmosphere { get; init; } | ||
|
||
[JsonProperty("distance", NullValueHandling = NullValueHandling.Ignore)] | ||
public MinMaxFilter? Distance { get; init; } | ||
} | ||
|
||
public class SortOption | ||
{ | ||
[JsonProperty("distance")] | ||
public DistanceSort Distance { get; init; } = new() { Direction = "asc" }; | ||
} | ||
|
||
public string Endpoint => "bodies/search"; | ||
public HttpMethod Method => HttpMethod.Post; | ||
} |
Oops, something went wrong.