Skip to content

Update dotnet monorepo to v9 (major) #3702

Update dotnet monorepo to v9 (major)

Update dotnet monorepo to v9 (major) #3702

Workflow file for this run

name: .NET
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
inputs:
publish-packages:
description: Publish packages?
type: boolean
required: true
default: false
is-alpha:
description: Alpha version?
type: boolean
required: true
default: true
env:
SOLUTIONS: ModularPipelines.sln ModularPipelines.Examples.sln src/ModularPipelines.Azure/ModularPipelines.Azure.sln src/ModularPipelines.AmazonWebServices/ModularPipelines.AmazonWebServices.sln src/ModularPipelines.Google/ModularPipelines.Google.sln
jobs:
pipeline:
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
NUGET_PACKAGES: ${{ matrix.os == 'windows-latest' && 'E:\nuget' || null }}
steps:
- name: Add mask
run: |
echo "::add-mask::${{ secrets.DOTNET_FORMAT_PUSH_TOKEN }}"
echo "::add-mask::${{ secrets.NuGet__ApiKey }}"
echo "::add-mask::${{ secrets.ADMIN_TOKEN }}"
echo "::add-mask::${{ secrets.CODACY_APIKEY }}"
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Set Up Performant Windows Drive
if: matrix.os == 'windows-latest'
uses: samypr100/setup-dev-drive@v3
with:
drive-size: 5GB
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Cache NuGet
uses: actions/cache@v4
with:
path: ${{ matrix.os == 'windows-latest' && format('{0}\{1}', env.DEV_DRIVE, 'nuget') || '~/.nuget/packages' }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget- }}
- name: Build ModularPipelines.Analyzers.sln
run: dotnet build ModularPipelines.Analyzers.sln -c Release
- name: Build
shell: bash
run: |
for SOLUTION in ${{ env.SOLUTIONS }}
do
dotnet build $SOLUTION -c Release
done
- name: Run Pipeline
run: dotnet run -c Release --framework net8.0
working-directory: "src/ModularPipelines.Build"
env:
GITHUB_TOKEN: ${{ github.token }}
DOTNET_ENVIRONMENT: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Development' }}
NuGet__ApiKey: ${{ github.ref == 'refs/heads/main' && secrets.NuGet__ApiKey || null }}
GitHub__Actor: ${{ github.actor }}
GitHub__Repository__Id: ${{ github.repository_id }}
GitHub__StandardToken: ${{ secrets.DOTNET_FORMAT_PUSH_TOKEN }}
GitHub__AdminToken: ${{ secrets.ADMIN_TOKEN }}
Publish__ShouldPublish: ${{ (github.event.inputs.publish-packages || false) && matrix.os == 'ubuntu-latest' }}
Publish__IsAlpha: ${{ github.event.inputs.is-alpha || true }}
Codacy__ApiKey: ${{ secrets.CODACY_APIKEY }}
CodeCov__Token: ${{ secrets.CODECOV_TOKEN }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}