diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 7781d7c..bbaf09e 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -1,19 +1,49 @@ name: .NET Core -on: push +on: + push: + workflow_dispatch: + release: + types: [published] + +env: + DEFAULT_VERSION: "3.1.0.4-alpha" + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 2.2.108 - - name: Build with dotnet - run: dotnet build --configuration Release - - name: Test - run: dotnet test src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj - - name: Publish - run: | - dotnet pack . -p:PackageVersion=3.1.0.6 -o . - dotnet nuget push src/PostalCodes/PostalCodes.3.1.0.6.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json \ No newline at end of file + - uses: actions/checkout@v4 + - name: Setup .NET Core 2.2 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 2.2.x + - name: Setup .NET Core 3.1 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 3.1.x + - name: Setup .NET 6 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Setup .NET 8 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x + - name: Build with dotnet + run: dotnet build --configuration Release /p:ContinuousIntegrationBuild=true + - name: Test + run: dotnet test src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj + - name: Extract Version from Release Tag + id: get_version + run: echo "VERSION=$(echo '${{ github.event.release.tag_name || env.DEFAULT_VERSION }}' | sed -e 's/^v\.//')" >> $GITHUB_ENV + - name: Create nuget package + run: dotnet pack . -p:PackageVersion=${{ env.VERSION }} -o out --no-build + - name: Install dotnet-validate + run: dotnet tool install --global dotnet-validate --version 0.0.1-preview.304 + + - name: Validate NuGet package + run: dotnet-validate package local out/*.nupkg + + - name: Publish + run: | + dotnet nuget push out/PostalCodes.${{ env.VERSION }}.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json diff --git a/PostalCodes.Net.nuspec b/PostalCodes.Net.nuspec deleted file mode 100644 index be9a663..0000000 --- a/PostalCodes.Net.nuspec +++ /dev/null @@ -1,21 +0,0 @@ - - - - PostalCodes - $version$ - PostalCodes - Rafał Nowosielski, Ivan Stanishev, Brendan Shea - Rafał Nowosielski - false - Copyright 2015 - PostalCode, ZipCode, PostalCodes, ZipCodes, postal-code, postal-codes, zip-code, zip-codes - - Library for managing postal codes for .NET - Library that provides zip code validation, formatting and simple arithmetic - en-US - - - - - - diff --git a/src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj b/src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj index 50cbf92..9dcce9c 100644 --- a/src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj +++ b/src/PostalCodes.UnitTests/PostalCodes.UnitTests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.1 + netcoreapp2.2;netcoreapp3.1;net6.0;net8.0 @@ -11,4 +11,4 @@ - \ No newline at end of file + diff --git a/src/PostalCodes/PostalCodes.csproj b/src/PostalCodes/PostalCodes.csproj index 67df4d7..a2d45e7 100644 --- a/src/PostalCodes/PostalCodes.csproj +++ b/src/PostalCodes/PostalCodes.csproj @@ -1,6 +1,6 @@  - netstandard2.0 + netstandard2.0;netcoreapp3.1;net6.0;net8.0 @@ -11,6 +11,21 @@ + + PostalCodes + + PostalCodes + Rafał Nowosielski, Ivan Stanishev, Brendan Shea + Library that provides zip code validation, formatting and simple arithmetic + Cimpress 2024 + PostalCode, ZipCode, PostalCodes, ZipCodes, postal-code, postal-codes, zip-code, zip-codes + git + https://github.com/Cimpress-MCP/PostalCodes.Net + + + true + snupkg + True @@ -18,4 +33,4 @@ PostalCodeFactory.gen.tt - \ No newline at end of file +