-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #28 from Amino-NET-Group/dev
Merge Amino.NET 1.5.2
- Loading branch information
Showing
8 changed files
with
1,971 additions
and
2,313 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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# These are supported funding model platforms | ||
|
||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
patreon: fabiogaming | ||
patreon: # | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
ko_fi: fabiothefox | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry | ||
custom: ["https://www.paypal.me/FabioTheFox", ] | ||
custom: [] |
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 @@ | ||
name: Publish NuGet Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '7.x' | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release | ||
|
||
- name: Determine version | ||
id: version | ||
run: echo "::set-output name=version::0.$((${GITHUB_RUN_NUMBER} / 10)).$((${GITHUB_RUN_NUMBER} % 10))" | ||
|
||
- name: Get Project Version | ||
id: base_version | ||
run: | | ||
version=$(grep '<Version>' < Amino.NET/Amino.NET.csproj | sed 's/.*<Version>\(.*\)<\/Version>/\1/') | ||
echo "::set-output name=version::$version" | ||
- name: Pack | ||
run: dotnet pack --configuration Release /p:Version="${{ steps.base_version.outputs.version }}-dev${{ steps.version.outputs.version }}" --output nupkgs | ||
|
||
- name: Publish to NuGet | ||
run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |
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,25 @@ | ||
name: Dev Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '7.x' | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore | ||
|
||
- name: Build and test | ||
run: dotnet build --configuration Release && dotnet test --no-build --verbosity normal |
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,64 @@ | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.IO; | ||
using System.Reflection.Metadata.Ecma335; | ||
|
||
namespace Amino.NET.Builders | ||
{ | ||
public class PostBuilder | ||
{ | ||
public byte[] CoverImage { get; private set; } | ||
public byte[] BackgroundImage { get; private set; } | ||
public string BackgroundColor { get; private set; } = "#ffffff"; | ||
public string Content { get; set; } | ||
public string Title { get; set; } | ||
public List<(byte[], string?, string?)> MediaList { get; } = new List<(byte[], string?, string?)>(); | ||
public PostTypes PostType { get; set; } = PostTypes.Blog; | ||
public BackgroundTypes BackgroundType { get; set; } = BackgroundTypes.Color; | ||
public bool FansOnly { get; set; } | ||
|
||
|
||
public void WithCover(byte[] cover) | ||
{ | ||
CoverImage = cover; | ||
} | ||
public void WithCover(string coverPath) | ||
{ | ||
WithCover(File.ReadAllBytes(coverPath)); | ||
} | ||
|
||
public void WithBackgroundImage(byte[] media) | ||
{ | ||
BackgroundImage = media; | ||
} | ||
|
||
public void WithBackgroundImage(string mediaPath) | ||
{ | ||
WithBackgroundImage(File.ReadAllBytes(mediaPath)); | ||
} | ||
|
||
public void AddMedia(byte[] media, string mediaKey = null, string caption = null) | ||
{ | ||
MediaList.Add((media, mediaKey, caption)); | ||
} | ||
|
||
public void AddMedia(string mediaPath, string mediaKey = null, string caption = null) | ||
{ | ||
AddMedia(File.ReadAllBytes(mediaPath), mediaKey, caption); | ||
} | ||
|
||
public string EmbedImage(string mediaKey) => $"[IMG={mediaKey}]"; | ||
|
||
public enum PostTypes | ||
{ | ||
Blog, | ||
Wiki | ||
} | ||
public enum BackgroundTypes | ||
{ | ||
Color, | ||
Image | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.