Repository navigation
207 lines (187 loc) · 6.49 KB
/
Copy pathrelease.yml
File metadata and controls
207 lines (187 loc) · 6.49 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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: release-solution-to-prod-spn
# prepare for releasing to prod:
# convert solution to managed (using a build PowerPlatform environment for the conversion)
# upload the solution to the GitHub artifacts and deploy to the PROD environment
on:
workflow_call :
inputs:
# Change this value
solution_name:
description: 'name of the solution'
required: true
type: string
branch_name:
description: 'name of the branch created'
required: true
type: string
#Do Not change these values
solution_shipping_folder:
description: 'folder name for staging the exported solution *do not change*'
type: string
default: out/ship/
solution_outbound_folder:
description: 'staging the unpacked solution folder before check-in *do not change*'
type: string
default: out/solutions/
solution_source_folder:
description: 'folder name to be created and checked in *do not change*'
type: string
default: solutions/
solution_release_folder:
description: 'folder where the released binaries are going to be hosted *do not change*'
type: string
default: out/release
secrets:
ENVIRONMENT_URL:
required: true
CLIENT_ID:
required: true
TENANT_ID:
required: true
CLIENT_SECRET:
required: true
release:
types: [created]
jobs:
convert-to-managed:
runs-on: windows-latest
# or you can say runs-on: ubuntu-latest
environment: build
env:
RUNNER_DEBUG: 1
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Pack solution
uses: microsoft/powerplatform-actions/pack-solution@v0
with:
solution-folder: ${{ inputs.solution_source_folder}}/${{ inputs.solution_name }}
solution-file: ${{ inputs.solution_outbound_folder}}/${{ inputs.solution_name }}.zip
solution-type: Unmanaged
- name: Import solution as unmanaged to build env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: ${{ secrets.ENVIRONMENT_URL }}
app-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
tenant-id: ${{ secrets.TENANT_ID }}
solution-file: ${{ inputs.solution_outbound_folder}}/${{ inputs.solution_name }}.zip
force-overwrite: true
publish-changes: true
- name: Export solution as managed
uses: microsoft/powerplatform-actions/export-solution@v0
with:
environment-url: ${{ secrets.ENVIRONMENT_URL }}
app-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
tenant-id: ${{ secrets.TENANT_ID }}
solution-name: ${{ inputs.solution_name }}
managed: true
solution-output-file: ${{ inputs.solution_shipping_folder}}/${{ inputs.solution_name }}.zip
- name: Upload the ready to ship solution to GH artifact store
uses: actions/upload-artifact@v2
with:
name: managedSolutions
path: ${{ inputs.solution_shipping_folder}}
if-no-files-found: error
sit:
needs: [ convert-to-managed ]
runs-on: windows-latest
environment: sit
env:
RUNNER_DEBUG: 1
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Fetch the ready to ship solution from GH artifact store
uses: actions/download-artifact@v2
with:
name: managedSolutions
path: ${{ inputs.solution_release_folder}}
- name: Import solution to env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: ${{ secrets.ENVIRONMENT_URL }}
app-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
tenant-id: ${{ secrets.TENANT_ID }}
solution-file: ${{ inputs.solution_release_folder}}/${{ inputs.solution_name }}_managed.zip
force-overwrite: true
publish-changes: true
uat:
needs: [ sit ]
runs-on: windows-latest
environment: uat
env:
RUNNER_DEBUG: 1
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Fetch the ready to ship solution from GH artifact store
uses: actions/download-artifact@v2
with:
name: managedSolutions
path: ${{ inputs.solution_release_folder}}
- name: Import solution to env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: ${{ secrets.ENVIRONMENT_URL }}
app-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
tenant-id: ${{ secrets.TENANT_ID }}
solution-file: ${{ inputs.solution_release_folder}}/${{ inputs.solution_name }}.zip
force-overwrite: true
publish-changes: true
prod:
needs: [ uat ]
runs-on: windows-latest
env:
RUNNER_DEBUG: 1
environment: prod
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Fetch the ready to ship solution from GH artifact store
uses: actions/download-artifact@v2
with:
name: managedSolutions
path: ${{ inputs.solution_release_folder}}
- name: Import solution to env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: ${{ secrets.ENVIRONMENT_URL }}
app-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
tenant-id: ${{ secrets.TENANT_ID }}
solution-file: ${{ inputs.solution_release_folder}}/${{ inputs.solution_name }}.zip
force-overwrite: true
publish-changes: true
data-migration:
needs: [ convert-to-managed ]
runs-on: windows-latest
env:
RUNNER_DEBUG: 1
environment: data-migration
steps:
- uses: actions/checkout@v2
with:
lfs: true
- name: Fetch the ready to ship solution from GH artifact store
uses: actions/download-artifact@v2
with:
name: managedSolutions
path: ${{ inputs.solution_release_folder}}
- name: Import solution to env
uses: microsoft/powerplatform-actions/import-solution@v0
with:
environment-url: ${{ secrets.ENVIRONMENT_URL }}
app-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
tenant-id: ${{ secrets.TENANT_ID }}
solution-file: ${{ inputs.solution_release_folder}}/${{ inputs.solution_name }}.zip
force-overwrite: true
publish-changes: true