Repository navigation
96 lines (88 loc) · 3.08 KB
/
Copy pathbuild.yml
File metadata and controls
96 lines (88 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- develop
- hotfix/*
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
permissions:
contents: write
id-token: write
packages: write
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
env:
TRUSTED_INGEST: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
steps:
- name: Get the sources
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install .NET SDK 8.0.x, 9.0.x & 10.0.x
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Install .NET SDK
uses: actions/setup-dotnet@v6
with:
global-json-file: global.json
- name: Azure login
if: ${{ env.TRUSTED_INGEST == 'true' && env.AZURE_CLIENT_ID != '' && env.AZURE_TENANT_ID != '' && env.AZURE_SUBSCRIPTION_ID != '' }}
uses: azure/login@v3
with:
client-id: ${{ env.AZURE_CLIENT_ID }}
tenant-id: ${{ env.AZURE_TENANT_ID }}
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}
- name: Run Cake script
uses: cake-build/cake-action@v3
env:
NuGetReportSettings_Endpoint: ${{ env.TRUSTED_INGEST == 'true' && secrets.NUGETREPORTSETTINGS_ENDPOINT || '' }}
NuGetReportSettings_RuleId: ${{ env.TRUSTED_INGEST == 'true' && secrets.NUGETREPORTSETTINGS_RULEID || '' }}
GH_PACKAGES_NUGET_SOURCE: ${{ secrets.GH_PACKAGES_NUGET_SOURCE }}
NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }}
NUGET_USER: ${{ secrets.NUGET_USER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_AUTHORITY_HOST: "https://login.microsoftonline.com"
AZURE_DOMAIN: ${{ secrets.AZURE_DOMAIN }}
with:
file-path: cake.cs
target: GitHub-Actions
- name: Setup Pages
if: runner.os == 'Linux' && github.ref == 'refs/heads/main'
uses: actions/configure-pages@v6
- name: Upload pages artifact
if: runner.os == 'Linux' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v5
with:
path: './artifacts/web/output'
deploy:
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5