-
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 branch 'master' of https://github.com/DSharpPlus/Bundles
- Loading branch information
Showing
9 changed files
with
104 additions
and
48 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,19 @@ | ||
name: Regenerate Resource Files | ||
|
||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/resources.yml" | ||
- "res/**" | ||
- "tools/generate-assets.sh" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
regenerate-assets: | ||
name: Regenerate Resource Files | ||
runs-on: self-hosted | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Generate Assets | ||
run: tools/generate-assets.sh |
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,39 +1,38 @@ | ||
<Project> | ||
|
||
<!-- build --> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>preview</LangVersion> | ||
<GenerateDocumentationFile>True</GenerateDocumentationFile> | ||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
<LangVersion>preview</LangVersion> | ||
<NoWarn>$(NoWarn);CS1591</NoWarn> | ||
|
||
<Nullable>enable</Nullable> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
<!-- build and versioning setup --> | ||
<ManagePackageVersionsCentrally>True</ManagePackageVersionsCentrally> | ||
<UseArtifactsOutput>true</UseArtifactsOutput> | ||
<NuGetAudit>true</NuGetAudit> | ||
|
||
<UseArtifactsOutput>true</UseArtifactsOutput> | ||
<!-- sourcelink --> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
</PropertyGroup> | ||
|
||
<!-- nuget --> | ||
<PropertyGroup> | ||
<Authors> | ||
akiraveliara, dotnet/corefxlab SlimDictionary contributors | ||
</Authors> | ||
<Description>A collection of collections and related types of varying usefulness.</Description> | ||
<Authors>Akiraveliara, dotnet/corefxlab SlimDictionary contributors</Authors> | ||
<Company>DSharpPlus Contributors</Company> | ||
<Description>A collection of collections and related types of varying usefulness.</Description> | ||
<PackageIcon>logo.png</PackageIcon> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<PackageProjectUrl>https://github.com/DSharpPlus/Bundles</PackageProjectUrl> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<RepositoryType>git</RepositoryType> | ||
<RepositoryUrl>https://github.com/DSharpPlus/Bundles</RepositoryUrl> | ||
<RepositoryType>Git</RepositoryType> | ||
<PackageLicenseExpression>MPL</PackageLicenseExpression> | ||
<PackageIcon>dsharpplus.png</PackageIcon> | ||
<PackageIconUrl>https://raw.githubusercontent.com/DSharpPlus/DSharpPlus/master/logo/dsharpplus.png</PackageIconUrl> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="../../LICENSE" Pack="true" PackagePath=""/> | ||
<EmbeddedResource Include="../../README.md" Pack="true" PackagePath=""/> | ||
<EmbeddedResource Include="../../res/logo.png" Pack="true" PackagePath=""/> | ||
</ItemGroup> | ||
</Project> |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Library</OutputType> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<IsAotCompatible>true</IsAotCompatible> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
<IsAotCompatible>true</IsAotCompatible> | ||
<OutputType>Library</OutputType> | ||
<PackageId>Bundles</PackageId> | ||
</PropertyGroup> | ||
|
||
</Project> | ||
</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,30 +1,17 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
|
||
<IsPackable>false</IsPackable> | ||
<IsTestProject>true</IsTestProject> | ||
<Nullable>enable</Nullable> | ||
<TargetFramework>net8.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" /> | ||
<PackageReference Include="xunit" /> | ||
<PackageReference Include="xunit.runner.visualstudio"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="coverlet.collector"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
<PackageReference Include="System.Net.Http" /> | ||
<PackageReference Include="System.Text.RegularExpressions" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Bundles\Bundles.csproj" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk"/> | ||
<PackageReference Include="System.Net.Http"/> | ||
<PackageReference Include="System.Text.RegularExpressions"/> | ||
<PackageReference Include="coverlet.collector" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" PrivateAssets="all"/> | ||
<PackageReference Include="xunit"/> | ||
<PackageReference Include="xunit.runner.visualstudio" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" PrivateAssets="all"/> | ||
<ProjectReference Include="../../src/Bundles/Bundles.csproj"/> | ||
</ItemGroup> | ||
|
||
</Project> | ||
</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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/bash | ||
|
||
# Deps | ||
xbps-install -Syu > /dev/null | ||
xbps-install -y ImageMagick yarn > /dev/null | ||
yarn global add svgo > /dev/null | ||
|
||
# Functions | ||
regenerate() | ||
{ | ||
echo "Generating assets for $1" | ||
|
||
# Optimize the SVG file | ||
svgo --multipass --quiet "$1" | ||
|
||
# Convert to PNG | ||
convert -size 1024x1024 -background transparent "$1" "${1%.*}.png" | ||
|
||
# Convert to ICO | ||
# https://stackoverflow.com/a/15104985 | ||
convert -background transparent -colors 256 "$1" \ | ||
\( -clone 0 -resize 16x16 \) \ | ||
\( -clone 0 -resize 32x32 \) \ | ||
\( -clone 0 -resize 48x48 \) \ | ||
\( -clone 0 -resize 64x64 \) \ | ||
\( -clone 0 -resize 128x128 \) \ | ||
\( -clone 0 -resize 256x256 \) \ | ||
-delete 0 "${1%.*}.ico" | ||
} | ||
|
||
# Iterate over each file matching the pattern "*.svg" in the "res" directory | ||
for file in res/*.svg; do | ||
# Execute the "regenerate" command on each file | ||
regenerate "$file" | ||
done | ||
|
||
# Check if any files were modified | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git add res > /dev/null | ||
git diff-index --quiet HEAD | ||
if [ "$?" == "1" ]; then | ||
git commit -m "[ci-skip] Regenerate resource files." > /dev/null | ||
git push > /dev/null | ||
else | ||
echo "No resource files were modified." | ||
fi |