diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c50bb5b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,49 @@ +name: Build NStack + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + outputs: + Version: ${{ steps.gitversion.outputs.SemVer }} + CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 #fetch-depth is needed for GitVersion + + #Install and calculate the new version with GitVersion + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v0.9.13 + with: + versionSpec: 5.x + - name: Determine Version + uses: gittools/actions/gitversion/execute@v0.9.13 + id: gitversion # step id used as reference for output values + - name: Display GitVersion outputs + run: | + echo "Version: ${{ steps.gitversion.outputs.SemVer }}" + echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" + + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build Debug + run: | + dotnet-gitversion /updateprojectfiles + dotnet build --no-restore -c Debug + + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e75bda7 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,53 @@ +name: Publish NStack.Core to NuGet +on: + push: + tags: + - v* + +jobs: + + publish: + name: build, pack & publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 #fetch-depth is needed for GitVersion + + - name: Install and calculate the new version with GitVersion + uses: gittools/actions/gitversion/setup@v0.9.13 + with: + versionSpec: 5.x + - name: Determine Version + uses: gittools/actions/gitversion/execute@v0.9.13 + id: gitversion # step id used as reference for output values + - name: Display GitVersion outputs + run: | + echo "Version: ${{ steps.gitversion.outputs.SemVer }}" + echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" + + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: 6.0.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build Release + run: | + dotnet-gitversion /updateprojectfiles + dotnet build --no-restore -c Release + + - name: Pack + run: dotnet pack -c Release -p:Version='${{ steps.gitversion.outputs.SemVer }}' -v d + + #- name: Prep GitHub Packages + # run: dotnet nuget add source --username tig --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/tig/index.json" + + #- name: Publish to GitHub packages + # run: dotnet nuget push NStack/bin/Release/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source "github" + + - name: Publish to NuGet.org + run: dotnet nuget push NStack/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 22f56ef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: csharp -solution: NStack.sln -script: - - msbuild /t:restore $TRAVIS_BUILD_DIR/NStack.sln - - cd $TRAVIS_BUILD_DIR - - msbuild /p:Configuration=Release NStack.sln - - nunit-console4 ./NStackTests/bin/Release/NStackTests.dll -mono: "5.2.0" -os: "osx" diff --git a/Makefile b/Makefile index eff9cf8..7658f87 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ all: dotnet-build doc-update yaml dotnet-build: + dotnet-gitversion /updateprojectfiles msbuild NStack.sln /t:clean /p:configuration=Release msbuild NStack.sln -t:restore -p:RestorePackagesConfig=true /p:configuration=Release msbuild NStack.sln /p:Configuration=Release /p:DocumentationFile="bin/Release/NStack.xml" diff --git a/NStack.sln b/NStack.sln index 3b3c83e..5df5d18 100644 --- a/NStack.sln +++ b/NStack.sln @@ -6,6 +6,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NStack", "NStack\NStack.csp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NStackTests", "NStackTests\NStackTests.csproj", "{21125504-5F4D-48A3-8978-A552627A8D26}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{760C271D-E55A-4F44-BE2C-9B476D310CAC}" + ProjectSection(SolutionItems) = preProject + .github\workflows\build.yml = .github\workflows\build.yml + .github\workflows\publish.yml = .github\workflows\publish.yml + README.md = README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/NStack/Makefile b/NStack/Makefile deleted file mode 100644 index c7d61d1..0000000 --- a/NStack/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -all: - echo use make package to create a new NuGet package - -package: - nuget pack NStack.Core.nuspec diff --git a/NStack/NStack.Core.nuspec b/NStack/NStack.Core.nuspec index 49575bf..d21d61f 100644 --- a/NStack/NStack.Core.nuspec +++ b/NStack/NStack.Core.nuspec @@ -2,7 +2,8 @@ NStack.Core - 0.4.0 + + 0.0.0 NStack.Core Miguel de Icaza Miguel de Icaza diff --git a/NStack/NStack.csproj b/NStack/NStack.csproj index 38e02f8..7a461fd 100644 --- a/NStack/NStack.csproj +++ b/NStack/NStack.csproj @@ -1,29 +1,29 @@ - - + - netstandard2.0 + https://github.com/tig/NStack NStack.Core true - 0.16 Miguel de Icaza MIT Miguel de Icaza http://github.com/migueldeicaza/NStack - NStack.Core brings a set of updated APIs to .NET including a UTF8-string aware string. + NStack.Core brings a set of updated string APIs to .NET including a UTF8-string aware string. unicode, c# NStack.Core - NStack.Core brings a set of updated APIs to .NET. + NStack.Core brings a set of updated string APIs to .NET. It starts with a new string type that is focused on Unicode code-points as opposed to the historical chars and UTF-16 encoding and introduces a utf8 string that supports slicing - 0.3 - 0.16: Fixes issue #51 (chess symbols); 0.15: Fixes to MaxRune; ColumnWidth differentiates between non-printable and nul characters; Rune has a constructor from two surrogate pairs; contributions by @BDisp; 0.14: Upgrade the NetStandard dependencies; - + +0.17: Fork by @tig modernize build/deploy and help publishing newer versions. No functional changes. +0.16: Fixes issue #51 (chess symbols); +0.15: Fixes to MaxRune; ColumnWidth differentiates between non-printable and nul characters; Rune has a constructor from two surrogate pairs; contributions by @BDisp; +0.14: Upgrade the NetStandard dependencies; 0.13: Fixes ustring.Map() and Lower(); Extends Rune.IsValid to match Go; add Rune.ExpectedSizeFromFirstByte() plus a bug fix; -stack 0.12: Rebuilt +stack +0.12: Rebuilt Rebuild with an older Roslyn, to prevent regressions on Xamarin. - 0.10: Merged some changes from upstream. @@ -34,12 +34,18 @@ Added ustring.ColumnWidth to return number of columns that a ustring takes in a * Renamed some methods to match the equivalent methods in Char. * Introduced Substring (int start) * Introduced difference between this [int start, int end] and this [int start, object end] the latter used to mean "until the end", replacing '0' as the previous value for "until the end". -* Introduced new method in Rune to measure the width in columns for console applications. +* Introduced new method in Rune to measure the width in columns for console applications. + + + + 0.20.0.0 + 0.20.0.0 + 0.20.0+Branch.main.Sha.8157792de6c7c039bf62aea2965505b27d1fffc9 + 0.20.0 - true - true + true bin\Release\NStack.xml Latest @@ -47,8 +53,8 @@ Added ustring.ColumnWidth to return number of columns that a ustring takes in a true Latest - - - - - + + + + + \ No newline at end of file diff --git a/NStackTests/NStackTests.csproj b/NStackTests/NStackTests.csproj index dcb6030..156d7c3 100644 --- a/NStackTests/NStackTests.csproj +++ b/NStackTests/NStackTests.csproj @@ -1,26 +1,24 @@  - - - net6.0 - enable - - false - - true - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - + + net6.0 + enable + false + true + 0.20.0.0 + 0.20.0.0 + 0.20.0+Branch.main.Sha.8157792de6c7c039bf62aea2965505b27d1fffc9 + 0.20.0 + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index f32df71..62046ab 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,11 @@ [![Build Status](https://travis-ci.org/migueldeicaza/NStack.svg?branch=master)](https://travis-ci.org/migueldeicaza/NStack) -Currently this module contains a port of the Go string, and Go rune -support as well as other Unicode helper methods. +Currently this library contains a port of the Go string, and Go rune support as well as other Unicode helper methods. You can browse the [API documentation](https://migueldeicaza.github.io/NStack/api/NStack.html). -Install the [NuGet package](https://www.nuget.org/packages/NStack.Core) by installing -`NStack.Core`. +Install the [NuGet package from NuGet.org](https://www.nuget.org/packages/NStack.Core) by installing `NStack.Core`. # Future Additions diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 89ae34a..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,26 +0,0 @@ -pool: - vmImage: 'macOS-10.14' - -variables: - buildConfiguration: 'Release' - -steps: -- script: | - msbuild /t:Restore NStack.sln - nuget restore - displayName: Restore dependencies - -- script: | - if echo $BUILD_SOURCEBRANCH | grep /release/; then perl -pi -e "s/PackageVersion>.*${BUILD_SOURCEBRANCHNAME}