Skip to content

Upgrade server to .NET 6 #462

Upgrade server to .NET 6

Upgrade server to .NET 6 #462

Workflow file for this run

name: .NET Core
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
id-token: write
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.402
- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Build with dotnet
run: dotnet build --configuration Release
package-web:
runs-on: [windows-latest]
name: Create Web package
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Publish with dotnet
run: dotnet publish --configuration Release --output publish-web FlightEvents.Web
- name: Collect artifact
uses: actions/upload-artifact@v3
with:
name: Website package
path: publish-web
package-client:
runs-on: [windows-latest]
name: Package Client
needs: [build]
steps:
- uses: actions/checkout@v3
- name: Clean
run: dotnet clean --configuration Release && dotnet nuget locals all --clear
- name: Publish with dotnet
run: dotnet publish --configuration Release --output publish-client --runtime win-x64 --self-contained true /p:PublishSingleFile=true /p:PublishReadyToRun=true FlightEvents.Client
- name: Copy extra content
run: |
copy FlightEvents.Client/appsettings.Release.json publish-client/appsettings.json
copy FlightEvents.Client/README.txt publish-client/README.txt
dir publish-client
- name: Collect build artifact
uses: actions/upload-artifact@v3
with:
name: FlightEvents.Client
path: publish-client
- name: Collect version artifact
uses: actions/upload-artifact@v3
with:
name: versions.json
path: FlightEvents.Client/versions.json
publish-client:
runs-on: [ubuntu-latest]
name: Publish Client
needs: [package-client]
if: "contains(github.event.head_commit.message, '/publish')"
steps:
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: FlightEvents.Client
path: publish-client/
- name: Download version artifact
uses: actions/download-artifact@v3
with:
name: versions.json
path: .
- name: Zip Release
uses: nguyenquyhy/[email protected]
with:
filename: ../FlightEvents.Client.zip
path: .
workingDirectory: publish-client/
- name: Azure Login
uses: Azure/[email protected]
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Upload FlightEvents.Client.zip via Azure CLI
uses: Azure/cli@v1
with:
inlineScript: az storage blob upload --account-name flightevents --container-name downloads --file FlightEvents.Client.zip --name FlightEvents.Client.zip --overwrite --auth-mode login
- name: Upload versions.json via Azure CLI
uses: Azure/cli@v1
with:
inlineScript: az storage blob upload --account-name flightevents --container-name downloads --file versions.json --name versions.json --overwrite --auth-mode login
- name: Azure logout
run: |
az logout
if: always()