-
-
Notifications
You must be signed in to change notification settings - Fork 8
349 lines (302 loc) · 11 KB
/
taggedRelease.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
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
#please edit public static version: string = '
name: "tagged-release to be moved some to NetCoreBlockly"
env:
DOTNET_VERSION: '6.0.x' # set this to the dot net version to use
AZURE_WEBAPP_NAME: 'AutoBlocklyApp'
on:
push:
tags:
- "vBlockly*"
workflow_dispatch:
jobs:
buildAngular:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.9.0]
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: put version
run: |
echo "${{github.ref_name}}"
echo "${{github.ref_name}}" > version.txt
- name: npm install
run: |
cd src
cd blockly10
npm i
# cd src
# cd react_new_app
# cd blockly_automation
# npm i
# cd src
# cd AngWorkspace
# npm i -g [email protected]
# npm i
# echo 'install angular'
#npm i @angular/[email protected]
# cd projects
# cd blockly-helpers
# npm i
# cd ..
# cd blockly-scripts
# npm i
# cd ..
# cd blockly-swagger
# npm i
# cd ..
# cd ..
# - name: fix bug #38
# run: |
# cd src
# cd AngWorkspace
# ./fix#38.ps1
# shell: pwsh
- name: npm modify docs
run: |
cd src
cd blockly10
npm run build
cd ..
cd ..
rm -r docs/*
cp -r src/blockly10/build/* docs/
cp docs/index.html docs/404.html
cd docs
echo "${{github.ref_name}}" > version.txt
cd ..
ls -l docs/
# cd src
# cd AngWorkspace
# echo "build"
# npm run buildGitHubPages
# ls -l dist/auto-blockly-app
# cd ..
# cd ..
# rm -r docs/*
# cp -r src/AngWorkspace/dist/auto-blockly-app/* docs/
# cp docs/index.html docs/404.html
# cd docs
# echo "${{github.ref_name}}" > version.txt
# cd ..
# ls -l docs/
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: AutoBlocklyApp
path: 'src/blockly10/build/*'
retention-days: 1
- name : autocommit
run: |
git config --global user.email "[email protected]"
git config --global user.name "Tagged release"
git add docs/.
git status --porcelain
git commit -am "Auto commit from Github Action" --allow-empty
git push origin HEAD:main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'releaseBlocklyAutomation.zip'
path: 'auto-blockly-app/'
directory: '${{github.workspace}}/src/blockly10/build/'
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: making releases of loaders
run: |
find ${{github.workspace}} -type f -name "*.zip"
cp ${{github.workspace}}/ssrc/blockly10/build/releaseBlocklyAutomation.zip ${{github.workspace}}/releaseBlocklyAutomation.zip
rm -r src/blockly10/build/*
cd src
cd blockly10
npm run build
cd ..
rm -r Loaders/SimpleSite/AutoBlocklySimple/wwwroot/BlocklyAutomation/*
cp -r src/blockly10/build/* Loaders/SimpleSite/AutoBlocklySimple/wwwroot/BlocklyAutomation/
rm -r Local/LocalAPI/LocalAPI/wwwroot/BlocklyAutomation/*
cp -r src/blockly10/build/* Local/LocalAPI/LocalAPI/wwwroot/BlocklyAutomation/
#cp -r Local/LocalAPI/LocalAPI/wwwroot/customBlocklyAutomation/* Local/LocalAPI/LocalAPI/wwwroot/BlocklyAutomation/
rm -r Local/LocalAPI/LocalAPI/wwwroot/customBlocklyAutomation/*
cd Loaders
cd SimpleSite
cd AutoBlocklySimple
dotnet publish -r win-x64 -c Release -o ${{env.AZURE_WEBAPP_NAME}}WinX64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true
dotnet publish -r linux-x64 -c Release -o ${{env.AZURE_WEBAPP_NAME}}linX64 --self-contained true -p:PublishSingleFile=true -p:PublishTrimmed=true
dotnet publish -r win-x64 -c Release -o ${{env.AZURE_WEBAPP_NAME}}IISWinX64 --self-contained true -p:PublishSingleFile=false -p:PublishTrimmed=false
- name: making releases of localApi
run: |
cd src
cd Local
cd LocalAPI
cd LocalAPI
dotnet publish -r win-x64 -c Release --self-contained -o ${{env.AZURE_WEBAPP_NAME}}LocalAPI
- name: Archive LocalAPI
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'releaseLocalAPI.zip'
path: '${{env.AZURE_WEBAPP_NAME}}LocalAPI/'
directory: '${{github.workspace}}/src/Local/LocalAPI/LocalAPI/'
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Archive Release Linux
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'releaseLin.zip'
path: '${{env.AZURE_WEBAPP_NAME}}linX64/'
directory: '${{github.workspace}}/src/Loaders/SimpleSite/AutoBlocklySimple/'
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Archive Release Windows
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'releaseWin.zip'
path: '${{env.AZURE_WEBAPP_NAME}}WinX64/'
directory: '${{github.workspace}}/src/Loaders/SimpleSite/AutoBlocklySimple/'
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Archive Release IIS
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'releaseIISWin.zip'
directory: '${{github.workspace}}/src/Loaders/SimpleSite/AutoBlocklySimple/'
path: '${{env.AZURE_WEBAPP_NAME}}IISWinX64/'
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: copy release
run: |
find ${{github.workspace}} -type f -name "*.zip"
cp ${{github.workspace}}/src/Loaders/SimpleSite/AutoBlocklySimple/releaseLin.zip ${{github.workspace}}/releaseLin.zip
cp ${{github.workspace}}/src/Loaders/SimpleSite/AutoBlocklySimple/releaseWin.zip ${{github.workspace}}/releaseWin.zip
cp ${{github.workspace}}/src/Loaders/SimpleSite/AutoBlocklySimple/releaseIISWin.zip ${{github.workspace}}/releaseIISWin.zip
# cp ${{github.workspace}}/src/AngWorkspace/releaseBlocklyAutomation.zip ${{github.workspace}}/releaseBlocklyAutomation.zip
cp ${{github.workspace}}/src/Local/LocalAPI/LocalAPI/releaseLocalAPI.zip ${{github.workspace}}/releaseLocalAPI.zip
echo 'copied'
find ${{github.workspace}} -type f -name "*.zip"
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: AllReleases
path: |
releaseBlocklyAutomation.zip
releaseLin.zip
releaseWin.zip
releaseIISWin.zip
releaseLocalAPI.zip
version.txt
retention-days: 1
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
releaseBlocklyAutomation.zip
releaseLin.zip
releaseWin.zip
releaseIISWin.zip
releaseLocalAPI.zip
version.txt
tag: v${{ env.GITHUB_SHA }}
tag_name: v${{ env.GITHUB_SHA }}
- name: delete older-releases@v0
uses: dev-drprasad/[email protected]
with:
#repo: <owner>/<repoName> # defaults to current repo
keep_latest: 2
#delete_tag_pattern: beta # defaults to ""
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
buildDesktop:
needs: buildAngular
runs-on: windows-latest
steps:
- name: 'Checkout Github Action'
uses: actions/checkout@master
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: AllReleases
- name: unzip ang archive
shell: pwsh
run: |
echo 'root'
dir
echo 'All releases'
dir AllReleases/*
Expand-Archive -LiteralPath "AllReleases/releaseBlocklyAutomation.zip" -DestinationPath "releaseBlocklyAutomation"
echo 'root'
dir
echo 'releaseBlocklyAutomation'
dir releaseBlocklyAutomation
echo 'All releases'
dir AllReleases/*
- name: build wpf
shell: pwsh
run: |
rm -r src\apps\wpf\WebView2WpfBrowser\dist\
cp -r releaseBlocklyAutomation\* src\apps\wpf\WebView2WpfBrowser\dist\
((Get-Content -path src\apps\wpf\WebView2WpfBrowser\dist\index.html -Raw) -replace 'base href="/BlocklyAutomation/"','base href="."') | Set-Content -Path src\apps\wpf\WebView2WpfBrowser\dist\index.html
cd src\apps\wpf\WebView2WpfBrowser
dotnet publish -r win-x64 -c Release -o ${{env.AZURE_WEBAPP_NAME}}WPF64 --self-contained
- name: zip wpf
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: 'releaseWPF64.zip'
directory: '${{github.workspace}}/src/apps/wpf/WebView2WpfBrowser'
path: '${{env.AZURE_WEBAPP_NAME}}WPF64/'
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: copy zip
run: |
# find ${{github.workspace}} -type f -name "*.zip"
cp ${{github.workspace}}\src\apps\wpf\WebView2WpfBrowser\releaseWPF64.zip ${{github.workspace}}/releaseWPF64.zip
cp -r AllReleases/* .
echo 'copied'
# find ${{github.workspace}} -type f -name "*.zip"
- name: Archive wpf
uses: actions/upload-artifact@v2
with:
name: wpf
path: |
releaseWPF64.zip
# releaseBlocklyAutomation.zip
# releaseLin.zip
# releaseWin.zip
# releaseIISWin.zip
# releaseLocalAPI.zip
# version.txt
retention-days: 1
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
releaseWPF64.zip
releaseBlocklyAutomation.zip
releaseLin.zip
releaseWin.zip
releaseIISWin.zip
releaseLocalAPI.zip
version.txt
# tag: v${{ env.GITHUB_SHA }}
# tag_name: v${{ env.GITHUB_SHA }}
- name: delete older-releases@v0
uses: dev-drprasad/[email protected]
with:
#repo: <owner>/<repoName> # defaults to current repo
keep_latest: 2
#delete_tag_pattern: beta # defaults to ""
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}