Skip to content

Commit

Permalink
Merge pull request #142 from Swimburger/niels/update-gh-actions
Browse files Browse the repository at this point in the history
Update GH actions
  • Loading branch information
dprothero authored Nov 26, 2024
2 parents f02901d + 19d8f09 commit 9f07c48
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 28 deletions.
52 changes: 27 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
default: 0.0.0-alpha
required: false
type: string

push:
branches: [ "main" ]
paths:
Expand All @@ -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
Expand All @@ -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/
Expand All @@ -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/
Expand All @@ -133,48 +135,48 @@ 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
with:
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: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions src/Twilio.AspNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 9f07c48

Please sign in to comment.