Skip to content

Bump Microsoft.Data.SqlClient from 5.2.1 to 5.2.2 (#1298) #424

Bump Microsoft.Data.SqlClient from 5.2.1 to 5.2.2 (#1298)

Bump Microsoft.Data.SqlClient from 5.2.1 to 5.2.2 (#1298) #424

Workflow file for this run

name: Build, Test, and Deploy
on:
push:
branches:
- main
# Allow manually triggering
workflow_dispatch:
jobs:
Website:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Restore NuGet packages
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --logger trx --results-directory TestResults --collect:"XPlat Code Coverage"
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# directory: ./TestResults
# flags: Website
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: website-test-results
path: ./TestResults
if: ${{ always() }} # Always run this step even on failure
- name: Publish
run: dotnet publish Website/Src --configuration Release --runtime linux-x64 --self-contained true -p:PublishReadyToRun=true -p:PublishSingleFile=true --no-restore --output artifacts
- name: Upload published website
uses: actions/upload-artifact@v4
with:
name: website-artifacts
path: ./artifacts
if: ${{ always() }} # Always run this step even on failure
WebClient:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '21.x'
- name: Install npm packages
run: npm ci
working-directory: ./WebClient
- name: Build
run: npm run build
working-directory: ./WebClient
- name: Test
run: npm run coverage
working-directory: ./WebClient
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# files: ./WebClient/logs/coverage/cobertura.xml
# flags: WebClient
# fail_ci_if_error: true
- name: Upload logs
uses: actions/upload-artifact@v4
with:
name: webclient-logs
path: ./WebClient/logs
if: ${{ always() }} # Always run this step even on failure
- name: Upload published web client
uses: actions/upload-artifact@v4
with:
name: webclient-artifacts
path: ./WebClient/dist
if: ${{ always() }} # Always run this step even on failure
Deploy:
runs-on: ubuntu-latest
needs: [Website, WebClient]
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Download website
uses: actions/download-artifact@v4
with:
name: website-artifacts
path: ./deploy
- name: Download web client
uses: actions/download-artifact@v4
with:
name: webclient-artifacts
path: ./deploy/wwwroot
- name: Create build info
shell: pwsh
run: |
./build/CreateBuildInfo.ps1 `
-SourceVersion "$Env:GITHUB_SHA" `
-BuildUrl "$Env:GITHUB_SERVER_URL/$Env:GITHUB_REPOSITORY/actions/runs/$Env:GITHUB_RUN_ID" `
-WebClientDirectory ./deploy/wwwroot `
-OutputDirectory ./deploy
- name: Deploy to Azure WebApps (staging slot)
uses: azure/webapps-deploy@v3
with:
app-name: ClickerHeroesTracker
slot-name: staging
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_STAGING }}
package: ./deploy
- name: Post-deploy
shell: pwsh
run: |
./build/PostDeploy.ps1 `
-WebsiteName ClickerHeroesTracker `
-Slot staging
# There is not an action to directly slot-swap, so use the Azure CLI
- name: Log into Azure CLI
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Swap staging slot to production slot
run: |
az webapp deployment slot swap -g default -n ClickerHeroesTracker --slot staging