-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (76 loc) · 2.38 KB
/
deploy-packages.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
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
name: deploy-packages
on:
workflow_call:
inputs:
runs-on:
description: 'The operating system to run the job on'
required: true
type: string
packages:
description: 'Array of packages to create'
required: true
type: string
publish-base:
description: 'Base path to publish artifact'
required: false
default: 'publish'
type: string
package-feed:
description: 'Where to publish package'
required: true
type: string
dotnet-version:
description: 'dotnet sdk version'
required: false
type: string
default: '8.x'
build-props-path:
description: 'Path to Directory.Build.props file'
required: false
type: string
default: 'Directory.Build.props'
secrets:
TOKEN:
required: true
jobs:
deploy:
runs-on: ${{inputs.runs-on}}
defaults:
run:
shell: pwsh
env:
prerelease: true
strategy:
matrix:
package: ${{fromJson(inputs.packages)}}
steps:
- uses: actions/checkout@v4
- name: read-version
id: read-version
uses: ./.github/actions/read-version
with:
build-props-path: ${{inputs.build-props-path}}
- name: dotnet-setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{inputs.dotnet-version}}
- name: dotnet-build
run: dotnet build "${{matrix.package}}" -c Release
- name: dotnet-pack
run: |
if ("${{steps.read-version.outputs.suffix}}")
{
Write-Output "Pack prerelease (build): ${{steps.read-version.outputs.build}}"
dotnet pack "${{matrix.package}}" -c Release -o "${{inputs.publish-base}}/nupkg" --no-build --version-suffix ci-${{steps.read-version.outputs.build}}
}
else
{
Write-Output "Pack release: ${{steps.read-version.outputs.prefix}}"
dotnet pack "${{matrix.package}}" -c Release -o "${{inputs.publish-base}}/nupkg" --no-build
}
- name: push-nupkg
uses: ./.github/actions/push-nupkg
with:
publish-base: ${{inputs.publish-base}}
api-key: ${{secrets.TOKEN}}
package-feed: ${{inputs.package-feed}}