-
-
Notifications
You must be signed in to change notification settings - Fork 10
56 lines (49 loc) · 1.53 KB
/
_build.yml
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
name: "Build"
on:
workflow_call:
inputs:
project-name:
description: 'The name of the project'
default: MailKitSimplified
type: string
outputs:
artifact:
description: 'Build artifact name'
value: ${{ jobs.build.outputs.artifact }}
jobs:
build:
name: Build
runs-on: 'ubuntu-latest'
env:
SOURCE: "source"
SENDER: "${{ inputs.project-name }}.Sender"
RECEIVER: "${{ inputs.project-name }}.Receiver"
NET_VERSION: '8.x'
outputs:
artifact: ${{ env.SOURCE }} # -${{ matrix.runs-on }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
# https://github.com/actions/setup-dotnet
- name: Get .NET ${{ env.NET_VERSION }} externals
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.NET_VERSION }}
dotnet-quality: 'ga'
- name: Restore project dependencies
shell: pwsh
run: |
Get-ChildItem -Path "./${{ env.SOURCE }}" -Filter "*er.csproj" -File -Recurse |
Select-Object -ExpandProperty BaseName | ForEach-Object {
dotnet restore "./${{ env.SOURCE }}/$_/$_.csproj" #Write-Output
}
# https://github.com/actions/upload-artifact
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.SOURCE }}
path: |
${{ env.SOURCE }}/${{ env.SENDER }}
${{ env.SOURCE }}/${{ env.RECEIVER }}
retention-days: 1
if-no-files-found: error # or 'ignore', defaults to `warn`