Skip to content

Az CLI

Az CLI #1690

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
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
jobs:
pipeline:
environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}
runs-on: ubuntu-latest
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@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Cache NuGet
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Build
run: dotnet build ModularPipelines.sln -c Release --framework net7.0
- name: Run Pipeline
run: dotnet run -c Release --framework net7.0
working-directory: "src/ModularPipelines.Build"
env:
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 }}
GitHub__PullRequest__Number: ${{ github.event.number }}
GitHub__PullRequest__Branch: ${{ github.event.pull_request.head.ref }}
GitHub__PullRequest__Sha: ${{ github.event.pull_request.head.sha }}
GitHub__PullRequest__Author: ${{ github.event.pull_request.user.login }}
Publish__ShouldPublish: ${{ github.event.inputs.publish-packages }}
Publish__IsAlpha: ${{ github.event.inputs.is-alpha }}
Codacy__ApiKey: ${{ secrets.CODACY_APIKEY }}
CodeCov__Token: ${{ secrets.CODECOV_TOKEN }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}