Skip to content

Commit

Permalink
Merge pull request #11 from ghost1face/release-prep
Browse files Browse the repository at this point in the history
Release prep
  • Loading branch information
ghost1face authored Nov 2, 2022
2 parents ea91bf8 + 4350f17 commit cf334de
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 39 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# editorconfig dotnet
root = true

# Default settings:
[*]
insert_final_newline = false
indent_style = space
indent_size = 2

[*.cs]
indent_style = space
indent_size = 4
end_of_line = crlf

# organize usings
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false
8 changes: 4 additions & 4 deletions .github/workflows/dotnet-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest
permissions:
packages: write
contents: read

steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- uses: actions/checkout@v3
- name: Setup .NET
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x' # SDK Version to use.
dotnet-version: 6.0.x
- run: dotnet build --configuration Release .
- name: Create the package
run: dotnet pack --configuration Release .
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
dotnet: [ '2.1.x', '3.1.x', '5.0.x' ]

steps:
- uses: actions/checkout@v2
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v1
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
15 changes: 10 additions & 5 deletions Base62.Tests/Base62.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>

<IsPackable>false</IsPackable>

<LangVersion>7.3</LangVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="1.2.0">
<PackageReference Include="coverlet.collector" Version="3.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="3.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

Expand Down
7 changes: 4 additions & 3 deletions Base62.Tests/Base62Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ public void ASCII_AND_UTF8_Can_RoundTrip(string input, string expected)
public void FirstZeroBytesAreConvertedCorrectly()
{
var sourceBytes = new byte[] { 0, 0, 1, 2, 0, 0 };
var encoded = Base62Converter.BaseConvert(sourceBytes, 256, 62);
var decoded = Base62Converter.BaseConvert(encoded, 62, 256);
var converter = new Base62Converter(Base62Converter.CharacterSet.DEFAULT);
var encoded = converter.Encode(sourceBytes);
var decoded = converter.Decode(encoded);

Assert.Equal(sourceBytes, decoded);

}

public static IEnumerable<object[]> GetData()
Expand Down
6 changes: 4 additions & 2 deletions Base62.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30804.86
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Base62", "Base62\Base62.csproj", "{AE1B5455-F004-4948-AE22-AC59C03C53BC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Base62.Tests", "Base62.Tests\Base62.Tests.csproj", "{11235960-3E83-46D3-A66B-F493894471C5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5CF4F621-110B-4ADF-A464-A75042EFCF6B}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.editorconfig = .editorconfig
LICENSE.md = LICENSE.md
README.md = README.md
EndProjectSection
Expand Down
27 changes: 10 additions & 17 deletions Base62/Base62.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard1.3;netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<Description>Base62 encoder and decoder for .NET for URL shortening and/or obfuscation.</Description>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsAsErrors />
<Copyright>2021</Copyright>
<Copyright>2022</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
<PackageProjectUrl>https://github.com/ghost1face/base62</PackageProjectUrl>
<RepositoryUrl>https://github.com/ghost1face/base62</RepositoryUrl>
<PackageTags>base62 encoder decoder url-shortener conversion</PackageTags>
<Authors>Daniel Destouche</Authors>
<Authors>ghost1face</Authors>
<PackageReleaseNotes>
* Expose methods for converting from array
* No direct .net framework support, netstandard1.3; netstandard2.0; netstandard2.1; net5.0 support going forward
* Addresses bug with leading zeros
</PackageReleaseNotes>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<FileVersion>1.2.0.0</FileVersion>
<AssemblyVersion>1.3.0.0</AssemblyVersion>
<FileVersion>1.3.0.0</FileVersion>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -32,27 +31,21 @@
</None>
</ItemGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>Base62.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<PropertyGroup Condition="$(Configuration) == 'Release'">
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.Github" Version="1.0.0">
<PackageReference Include="Microsoft.SourceLink.Github" Version="1.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.0.0">
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion Base62/Base62Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public byte[] Decode(byte[] value)
/// <param name="sourceBase">Source base to convert from.</param>
/// <param name="targetBase">Target base to convert to.</param>
/// <returns>Converted byte array.</returns>
internal static byte[] BaseConvert(byte[] source, int sourceBase, int targetBase)
private static byte[] BaseConvert(byte[] source, int sourceBase, int targetBase)
{
if (targetBase < 2 || targetBase > 256)
throw new ArgumentOutOfRangeException(nameof(targetBase), targetBase, "Value must be between 2 & 256 (inclusive)");
Expand Down

0 comments on commit cf334de

Please sign in to comment.