diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d5e5b8..efc432a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: default: 0.0.0-alpha required: false type: string - + push: branches: [ "main" ] paths: @@ -30,24 +30,26 @@ on: description: 'The version of the library to use when compiling and packaging.' required: true -env: +env: CI: true DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_NOLOGO: true - + jobs: build: name: Build, test, and pack runs-on: windows-latest permissions: + contents: read + actions: read checks: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: - dotnet-version: 7.0.x + dotnet-version: 9.0.x dotnet-quality: ga - name: Update project versions @@ -62,52 +64,52 @@ jobs: } } shell: pwsh - + # Build and pack Twilio.AspNet.Common - name: (Twilio.AspNet.Common) Restore run: dotnet restore working-directory: src/Twilio.AspNet.Common/ shell: pwsh - + - name: (Twilio.AspNet.Common) Build run: dotnet build --no-restore --configuration Release working-directory: src/Twilio.AspNet.Common/ shell: pwsh - + - name: (Twilio.AspNet.Common) Pack run: dotnet pack -c Release -o ..\..\ working-directory: src/Twilio.AspNet.Common/ shell: pwsh - name: (Twilio.AspNet.Common) Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Twilio.AspNet.Common NuGet Package path: | Twilio.AspNet.Common.${{ inputs.libraryVersion || '0.0.0-alpha' }}.nupkg Twilio.AspNet.Common.${{ inputs.libraryVersion || '0.0.0-alpha' }}.snupkg - + # Build, test, and pack Twilio.AspNet.Core - name: (Twilio.AspNet.Core) Restore run: dotnet restore working-directory: src/Twilio.AspNet.Core/ shell: pwsh - + - name: (Twilio.AspNet.Core) Build run: dotnet build --no-restore --configuration Release working-directory: src/Twilio.AspNet.Core/ shell: pwsh - + - name: (Twilio.AspNet.Core.UnitTests) Restore run: dotnet restore working-directory: src/Twilio.AspNet.Core.UnitTests/ shell: pwsh - + - name: (Twilio.AspNet.Core.UnitTests) Build run: dotnet build --no-restore working-directory: src/Twilio.AspNet.Core.UnitTests/ shell: pwsh - + - name: (Twilio.AspNet.Core.UnitTests) Test run: dotnet test --no-build --logger trx working-directory: src/Twilio.AspNet.Core.UnitTests/ @@ -120,7 +122,7 @@ jobs: name: Twilio.AspNet.Core.UnitTests path: src/Twilio.AspNet.Core.UnitTests/TestResults/*.trx reporter: dotnet-trx - + - name: (Twilio.AspNet.Core) Pack run: dotnet pack -c Release -o ..\..\ working-directory: src/Twilio.AspNet.Core/ @@ -133,33 +135,33 @@ jobs: path: | Twilio.AspNet.Core.${{ inputs.libraryVersion || '0.0.0-alpha' }}.nupkg Twilio.AspNet.Core.${{ inputs.libraryVersion || '0.0.0-alpha' }}.snupkg - + # Build, test, and pack Twilio.AspNet.Mvc - name: (Twilio.AspNet.Mvc) Restore run: dotnet restore working-directory: src/Twilio.AspNet.Mvc/ shell: pwsh - + - name: (Twilio.AspNet.Mvc) Build run: dotnet build --no-restore --configuration Release working-directory: src/Twilio.AspNet.Mvc/ shell: pwsh - + - name: (Twilio.AspNet.Mvc.UnitTests) Restore run: dotnet restore working-directory: src/Twilio.AspNet.Mvc.UnitTests/ shell: pwsh - + - name: (Twilio.AspNet.Mvc.UnitTests) Build run: dotnet build --no-restore working-directory: src/Twilio.AspNet.Mvc.UnitTests/ shell: pwsh - + - name: (Twilio.AspNet.Mvc.UnitTests) Test run: dotnet test --no-build --logger trx working-directory: src/Twilio.AspNet.Mvc.UnitTests/ shell: pwsh - + - name: (Twilio.AspNet.Mvc.UnitTests) Report Tests uses: dorny/test-reporter@v1 if: success() || failure() # run this step even if previous step failed @@ -167,14 +169,14 @@ jobs: name: Twilio.AspNet.Mvc.UnitTests path: src/Twilio.AspNet.Mvc.UnitTests/TestResults/*.trx reporter: dotnet-trx - + - name: (Twilio.AspNet.Mvc) Pack run: dotnet pack -c Release -o ..\..\ working-directory: src/Twilio.AspNet.Mvc/ shell: pwsh - + - name: (Twilio.AspNet.Mvc) Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Twilio.AspNet.Mvc NuGet Package path: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aea65e4..1c63116 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,17 +33,17 @@ jobs: runs-on: ubuntu-latest needs: [build] steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 name: Download Twilio.AspNet.Common NuGet Package with: name: Twilio.AspNet.Common NuGet Package - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 name: Download Twilio.AspNet.Core NuGet Package with: name: Twilio.AspNet.Core NuGet Package - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 name: Download Twilio.AspNet.Mvc NuGet Package with: name: Twilio.AspNet.Mvc NuGet Package diff --git a/src/Twilio.AspNet.sln b/src/Twilio.AspNet.sln index e5d2ada..386ed3b 100644 --- a/src/Twilio.AspNet.sln +++ b/src/Twilio.AspNet.sln @@ -31,6 +31,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Twilio.AspNet.Mvc.UnitTests EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Twilio.AspNet.Core.UnitTests", "Twilio.AspNet.Core.UnitTests\Twilio.AspNet.Core.UnitTests.csproj", "{B3E732C9-27EF-4E96-B620-5B5DA57D9AD3}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{14C361F2-74BC-4D62-AC32-8B640D28A94F}" + ProjectSection(SolutionItems) = preProject + ..\.github\workflows\release.yml = ..\.github\workflows\release.yml + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{5001EA6E-22E1-454C-8746-D76CD562D89B}" + ProjectSection(SolutionItems) = preProject + ..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -64,4 +74,8 @@ Global GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7D0F9171-129A-4B05-809E-F501DBC23197} EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {14C361F2-74BC-4D62-AC32-8B640D28A94F} = {339A75DF-3315-4CF3-9FD9-DAF1B0DB50B2} + {5001EA6E-22E1-454C-8746-D76CD562D89B} = {14C361F2-74BC-4D62-AC32-8B640D28A94F} + EndGlobalSection EndGlobal