forked from BusinessCentralApps/GenerateBcNuGet
-
Notifications
You must be signed in to change notification settings - Fork 1
165 lines (153 loc) · 7.13 KB
/
generateRuntimeFromNuGet.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Generate Runtime Packages From NuGet
# Controls when the workflow will run
on:
workflow_dispatch:
inputs:
nuGetServerUrl:
description: NuGet server URL (leave empty to use RUNTIMENUGETSERVERURL variable)
required: false
default: ''
nuGetToken:
description: NuGet auth token (leave empty to use RUNTIMENUGETTOKEN or NUGETTOKEN secret)
required: false
default: ''
fromNugetServerUrl:
description: NuGet server URL
required: false
default: ''
fromNugetToken:
description: NuGet auth token
required: false
default: ''
fromApps:
description: Comma separated list of nuget package names
required: false
default: ''
fromDependencies:
description: Comma separated list of nuget package names
required: false
default: ''
country:
description: Country for the main runtime version (leave empty to use COUNTRY variable, default is w1)
required: false
default: ''
additionalCountries:
description: Comma separated list of additional countries (leave empty to use ADDITIONALCOUNTRIES variable, default is none)
required: false
default: ''
# artifactVersion:
# description: Business Central artifacts version range (leave empty to use ARTIFACTVERSION variable, default is to auto-calculate needed artifacts)
# required: false
# default: ''
# artifactType:
# description: Type of Business Central artifacts to use, onprem or sandbox (leave empty to use ARTIFACTTYPE variable, default is sandbox)
# required: false
# default: ''
licenseFileUrl:
description: License File URL to use for versions before 22.0 (leave empty to use LICENSEFILEURL secret)
required: false
default: ''
# run-name:
# description: Name of the run (leave empty to use the default name)
# required: false
# default: ''
run-name: ${{ github.event.inputs.run-name != '' && github.event.inputs.run-name || github.workflow }}
concurrency:
group: ${{ github.event.inputs.run-name != '' && github.event.inputs.run-name || github.workflow }}
cancel-in-progress: false
jobs:
DetermineArtifacts:
name: Determine Business Central Artifacts
runs-on: [ ubuntu-latest ]
permissions:
contents: read
outputs:
artifactVersions: ${{ steps.determineArtifacts.outputs.ArtifactVersions }}
artifactVersionCount: ${{ steps.determineArtifacts.outputs.ArtifactVersionCount }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Mask input
shell: pwsh
env:
secrets: ${{ toJson(secrets) }}
run: |
. (Join-Path $env:GITHUB_WORKSPACE "MaskInput.ps1")
- name: Determine Artifacts
id: determineArtifacts
shell: pwsh
env:
nuGetToken: ${{ github.event.inputs.nuGetToken != '' && github.event.inputs.nuGetToken || (secrets.RUNTIMENUGETTOKEN != '' && secrets.RUNTIMENUGETTOKEN || secrets.NUGETTOKEN) }}
nuGetServerUrl: ${{ github.event.inputs.nuGetServerUrl != '' && github.event.inputs.nuGetServerUrl || vars.RUNTIMENUGETSERVERURL }}
fromNugetServerUrl: ${{ github.event.inputs.fromNugetServerUrl }}
fromNugetToken: ${{ github.event.inputs.fromNugetToken }}
fromApps: ${{ github.event.inputs.fromApps }}
apps: ''
country: ${{ github.event.inputs.country != '' && github.event.inputs.country || vars.COUNTRY }}
artifactVersion: ''
artifactType: ${{ github.event.inputs.artifactType != '' && github.event.inputs.artifactType || vars.ARTIFACTTYPE }}
run: |
. (Join-Path $env:GITHUB_WORKSPACE "DetermineArtifacts.ps1")
GenerateRuntimeNuGetPackages:
needs: [ DetermineArtifacts ]
if: needs.DetermineArtifacts.outputs.artifactVersionCount > 0
runs-on: [ windows-latest ]
strategy:
matrix:
include: ${{ fromJson(needs.DetermineArtifacts.outputs.artifactVersions) }}
fail-fast: false
max-parallel: 12
name: Runtime ${{ matrix.artifactVersion }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Mask input
shell: pwsh
env:
secrets: ${{ toJson(secrets) }}
run: |
. (Join-Path $env:GITHUB_WORKSPACE "MaskInput.ps1")
- name: Generate Runtime NuGet Packages
shell: pwsh
env:
nuGetToken: ${{ github.event.inputs.nuGetToken != '' && github.event.inputs.nuGetToken || (secrets.RUNTIMENUGETTOKEN != '' && secrets.RUNTIMENUGETTOKEN || secrets.NUGETTOKEN) }}
nuGetServerUrl: ${{ github.event.inputs.nuGetServerUrl != '' && github.event.inputs.nuGetServerUrl || (vars.RUNTIMENUGETSERVERURL != '' && vars.RUNTIMENUGETSERVERURL || vars.NUGETSERVERURL) }}
fromApps: ${{ github.event.inputs.fromApps }}
fromNugetServerUrl: ${{ github.event.inputs.fromNugetServerUrl }}
fromNugetToken: ${{ github.event.inputs.fromNugetToken }}
apps: ''
fromDependencies: ${{ github.event.inputs.fromDependencies }}
dependencies: ''
country: ${{ github.event.inputs.country != '' && github.event.inputs.country || vars.COUNTRY }}
additionalCountries: ${{ github.event.inputs.additionalCountries != '' && github.event.inputs.additionalCountries || vars.ADDITIONALCOUNTRIES }}
artifactType: ${{ github.event.inputs.artifactType != '' && github.event.inputs.artifactType || vars.ARTIFACTTYPE }}
licenseFileUrl: ${{ github.event.inputs.licenseFileUrl != '' && github.event.inputs.licenseFileUrl || secrets.LICENSEFILEURL }}
artifactVersion: ${{ matrix.artifactVersion }}
incompatibleArtifactVersion: ${{ matrix.incompatibleArtifactVersion }}
run: |
. (Join-Path $env:GITHUB_WORKSPACE "GenerateRuntimeNuGetPackages.ps1")
GenerateIndirectNuGetPackage:
name: Generate Indirect NuGet Package
needs: [ DetermineArtifacts, GenerateRuntimeNuGetPackages ]
if: needs.DetermineArtifacts.outputs.artifactVersionCount > 0
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Mask input
shell: pwsh
env:
secrets: ${{ toJson(secrets) }}
run: |
. (Join-Path $env:GITHUB_WORKSPACE "MaskInput.ps1")
- name: Generate Indirect NuGet Package
shell: pwsh
env:
nuGetToken: ${{ github.event.inputs.nuGetToken != '' && github.event.inputs.nuGetToken || (secrets.RUNTIMENUGETTOKEN != '' && secrets.RUNTIMENUGETTOKEN || secrets.NUGETTOKEN) }}
nuGetServerUrl: ${{ github.event.inputs.nuGetServerUrl != '' && github.event.inputs.nuGetServerUrl || (vars.RUNTIMENUGETSERVERURL != '' && vars.RUNTIMENUGETSERVERURL || vars.NUGETSERVERURL) }}
fromNugetServerUrl: ${{ github.event.inputs.fromNugetServerUrl }}
fromNugetToken: ${{ github.event.inputs.fromNugetToken }}
fromApps: ${{ github.event.inputs.fromApps }}
apps: ''
run: |
. (Join-Path $env:GITHUB_WORKSPACE "GenerateIndirectPackage.ps1")