Skip to content

Commit

Permalink
Update GHA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
justinyoo committed Nov 5, 2023
1 parent 45edeb4 commit 8f45901
Showing 1 changed file with 49 additions and 13 deletions.
62 changes: 49 additions & 13 deletions .github/workflows/azure-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,44 +25,80 @@ jobs:
build-test:
name: Build Test

runs-on: ubuntu-latest
strategy:
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET SDK
- name: Setup .NET SDK - .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
dotnet-version: 8.x
dotnet-quality: 'preview'

- name: Restore NuGet packages
- name: Add msbuild to PATH
if: matrix.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1

- name: Restore NuGet packages - Ubuntu
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
dotnet restore
dotnet restore YouTubeSummariser.sln
# - name: Restore NuGet packages - Windows
# if: matrix.os == 'windows-latest'
# shell: bash
# run: |
# dotnet restore YouTubeSummariserWin.sln

- name: Build solution
- name: Build solution - Ubuntu
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
dotnet build -c Release
dotnet build YouTubeSummariser.sln -c Release
- name: Test solution
- name: Build solution - Windows
if: matrix.os == 'windows-latest'
shell: bash
run: |
dotnet test -c Release
msbuild YouTubeSummariserWin.sln -t:rebuild -p:Configuration=Release
- name: Create artifacts
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
- name: Test solution - Ubuntu
if: matrix.os == 'ubuntu-latest'
shell: bash
run: |
dotnet test YouTubeSummariser.sln -c Release
# - name: Test solution - Windows
# if: matrix.os == 'windows-latest'
# shell: bash
# run: |
# dotnet test YouTubeSummariserWin.sln -c Release

- name: Create artifacts - Ubuntu
if: matrix.os == 'ubuntu-latest' && (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
shell: bash
run: |
dotnet publish -c Release
dotnet publish YouTubeSummariser.sln -c Release
# - name: Create artifacts - Windows
# if: matrix.os == 'windows-latest' && (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
# shell: bash
# run: |
# dotnet publish YouTubeSummariserWin.sln -c Release

- name: Upload artifact - API
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v3
with:
name: apiapp
path: src/YouTubeSummariser.ApiApp/bin/Release/net7.0/publish
path: src/YouTubeSummariser.ApiApp/bin/Release/net8.0/publish

deploy:
name: Deploy
Expand Down

0 comments on commit 8f45901

Please sign in to comment.