Skip to content

Commit 0f9c2af

Browse files
Update cp_latest_dispatch.yml
1 parent 20c712a commit 0f9c2af

File tree

1 file changed

+27
-54
lines changed

1 file changed

+27
-54
lines changed

.github/workflows/cp_latest_dispatch.yml

Lines changed: 27 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ on:
3636
required: true
3737
default: 'Google'
3838

39+
defaults:
40+
run:
41+
shell: pwsh
42+
3943
env:
4044
OS_ARCH: ${{ github.event.inputs.os-and-arch }}
4145
PATCH_SERVER_PORT: ${{ github.event.inputs.patch-server-port }}
@@ -46,17 +50,15 @@ env:
4650
PATCH_USER_PROVIDER: ${{ github.event.inputs.patch-user-provider }}
4751

4852
jobs:
49-
5053
init_os_arch:
51-
runs-on: windows-latest
54+
runs-on: ubuntu-latest
5255
outputs:
5356
library_extension: ${{ steps.set_library_extension.outputs.library_extension }}
5457
arch_code: ${{ steps.set_arch.outputs.arch_code }}
5558

5659
steps:
5760
- name: Set Library Extension (dll / so / dylib)
5861
id: set_library_extension
59-
shell: pwsh
6062
run: |
6163
$extension = 'not-selected'
6264
@@ -74,7 +76,6 @@ jobs:
7476

7577
- name: Set Library Extension (dll / so / dylib)
7678
id: set_arch
77-
shell: pwsh
7879
run: |
7980
$arch = 'not-selected'
8081
@@ -95,40 +96,21 @@ jobs:
9596
"arch_code=$arch" | Out-File -Append -FilePath $env:GITHUB_OUTPUT
9697

9798
scrape_fe_version:
98-
runs-on: windows-latest
99+
runs-on: ubuntu-latest
99100

100101
outputs:
101-
scraped_version: ${{ steps.set_scraped_version.outputs.scraped_version }}
102-
103-
env:
104-
NODE_JS_VERSION: 23.1.0
102+
scraped_version: ${{ steps.get_version.outputs.scraped_version }}
105103

106104
steps:
107105
- uses: actions/checkout@v4
108-
109-
- name: Use Node.js ${{ env.NODE_JS_VERSION }}
110-
uses: actions/setup-node@v4
111-
with:
112-
node-version: ${{ env.NODE_JS_VERSION }}
113-
cache: 'npm' # Auto-caches npm dependencies
114-
cache-dependency-path: utils/fe-version-scraper/package-lock.json
115-
116-
- name: Install Node.js dependencies
117-
run: npm ci
118-
working-directory: utils/fe-version-scraper
119106

120-
- name: Run the Node.js script
121-
run: node .
107+
- name: Run the Powershell script
108+
id: get_version
122109
working-directory: utils/fe-version-scraper
123-
124-
- name: Read & Set Env
125-
id: set_scraped_version
126-
run: |
127-
$fileContent = Get-Content -Path "utils/fe-version-scraper/latest_version.txt" -Raw
128-
echo "scraped_version=$fileContent" | Out-File -Append -FilePath $env:GITHUB_OUTPUT
110+
run: ./GetLatest-FEVersion.ps1
129111

130112
download-Yui-patch:
131-
runs-on: windows-latest
113+
runs-on: ubuntu-latest
132114
needs:
133115
- scrape_fe_version
134116
- init_os_arch
@@ -158,42 +140,39 @@ jobs:
158140
} else {
159141
echo "IS_COMPATIBLE_CONT=false" | Out-File -Append -FilePath $env:GITHUB_ENV
160142
}
161-
162-
shell: pwsh
163143

164144
- name: Set IS_COMPATIBLE_CONT as Output
165145
id: is-compatible-cont
166-
run: echo "is-compatible-cont=${{ env.IS_COMPATIBLE_CONT }}" | Out-File -Append -FilePath $env:GITHUB_OUTPUT
146+
run: echo "is-compatible-cont=${{ env.IS_COMPATIBLE_CONT }}" >> $env:GITHUB_OUTPUT
167147

168148
- name: Set Yui name
169-
run: echo "YUI_NAME=yui" | Out-File -Append -FilePath $env:GITHUB_ENV
170-
149+
run: echo "YUI_NAME=yui" >> $env:GITHUB_ENV
150+
171151
- name: Set Yui fiddler name (>= 5.17.0)
172152
if: env.IS_COMPATIBLE_CONT == 'true'
173153
run: |
174-
echo "Yui_FIDDLER_NAME=fiddler.$env:LIBRARY_EXTENSION" | Out-File -Append -FilePath $env:GITHUB_ENV
175-
echo "Yui_FIDDLER_NAME_NO_EXTENSION=fiddler" | Out-File -Append -FilePath $env:GITHUB_ENV
154+
echo "Yui_FIDDLER_NAME=fiddler.$env:LIBRARY_EXTENSION" >> $env:GITHUB_ENV
155+
echo "Yui_FIDDLER_NAME_NO_EXTENSION=fiddler" >> $env:GITHUB_ENV
176156
177157
- name: Set Yui fiddler name (< 5.17.0 or on linux)
178158
if: env.IS_COMPATIBLE_CONT == 'false' || env.OS_ARCH == 'Linux (x86_64)'
179159
run: |
180-
echo "Yui_FIDDLER_NAME=libfiddler.$env:LIBRARY_EXTENSION" | Out-File -Append -FilePath $env:GITHUB_ENV
181-
echo "Yui_FIDDLER_NAME_NO_EXTENSION=libfiddler" | Out-File -Append -FilePath $env:GITHUB_ENV
182-
160+
echo "Yui_FIDDLER_NAME=libfiddler.$env:LIBRARY_EXTENSION" >> $env:GITHUB_ENV
161+
echo "Yui_FIDDLER_NAME_NO_EXTENSION=libfiddler" >> $env:GITHUB_ENV
162+
183163
- name: Set Yui_FIDDLER_NAME as Output
184164
id: Yui-fiddler-name
185-
run: echo "Yui-fiddler-name=${{ env.Yui_FIDDLER_NAME }}" | Out-File -Append -FilePath $env:GITHUB_OUTPUT
165+
run: echo "Yui-fiddler-name=${{ env.Yui_FIDDLER_NAME }}" >> $env:GITHUB_OUTPUT
186166

187167
- name: Create Yui directory
188168
run: |
189169
if (-Not (Test-Path "Yui")) {
190170
New-Item -ItemType Directory -Path "Yui"
191171
}
192-
shell: pwsh
193172
194173
- name: Set Yui Release
195174
if: env.IS_COMPATIBLE_CONT == 'true'
196-
run: echo "Yui_RELEASE=continuous" | Out-File -Append -FilePath $env:GITHUB_ENV
175+
run: echo "Yui_RELEASE=continuous" >> $env:GITHUB_ENV
197176

198177
- name: Download Yui Patch
199178
run: |
@@ -214,7 +193,6 @@ jobs:
214193
Write-Error "Failed to download the patch files. Error details: $_"
215194
exit 1
216195
}
217-
shell: pwsh
218196
219197
- name: Upload Yui folder as an artifact
220198
uses: actions/upload-artifact@v4
@@ -224,7 +202,7 @@ jobs:
224202
if-no-files-found: error
225203

226204
download-msojocs-server:
227-
runs-on: windows-latest
205+
runs-on: ubuntu-latest
228206

229207
steps:
230208
- name: Set up Git
@@ -235,13 +213,13 @@ jobs:
235213
236214
- name: Configure sparse-checkout to download the server directory
237215
run: |
238-
echo "server" | Out-File -Append -FilePath .git\info\sparse-checkout
216+
Set-Content -Path ".git/info/sparse-checkout" -Value "server"
239217
git pull origin main
240218
241219
- name: Move the downloaded directory to the target folder
242220
run: |
243-
mkdir -p msojocs
244-
Move-Item -Path server -Destination msojocs/
221+
New-Item -ItemType Directory -Path "msojocs" -Force
222+
Move-Item -Path "server" -Destination "msojocs/"
245223
246224
- name: List files in the msojocs/server directory
247225
run: Get-ChildItem -Path msojocs\server
@@ -255,7 +233,7 @@ jobs:
255233

256234
download-fiddler-everywhere-windows:
257235
if: ${{ github.event.inputs.os-and-arch == 'Windows (x86_64)' }}
258-
runs-on: windows-latest
236+
runs-on: ubuntu-latest
259237
needs:
260238
- scrape_fe_version
261239

@@ -284,7 +262,6 @@ jobs:
284262

285263
- name: Extract app
286264
run: 7z x "fe_extracted/`$PLUGINSDIR/app-64.7z" -ofe_app
287-
shell: pwsh
288265

289266
- name: Upload Fiddler Everywhere Extracted folder as an artifact
290267
uses: actions/upload-artifact@v4
@@ -371,9 +348,8 @@ jobs:
371348
Write-Host "SCRAPED_VERSION is empty or not set"
372349
exit 1
373350
}
374-
shell: pwsh
375351
376-
- name: Extract AppImage
352+
- name: Extract Dmg
377353
run: |
378354
hdiutil attach FiddlerEverywhere.dmg
379355
cp -R /Volumes/FiddlerEverywhere/* ./fe_app/
@@ -431,7 +407,6 @@ jobs:
431407
Get-ChildItem -Recurse Yui-patch
432408
Get-ChildItem -Recurse msojocs-patch
433409
Get-ChildItem -Recurse fe_app
434-
shell: pwsh
435410
436411
- name: Rename main FE folder
437412
run: Rename-Item -Path "fe_app" -NewName "FE"
@@ -447,7 +422,6 @@ jobs:
447422
} else {
448423
Write-Host "fiddler / libfiddler or Yui patch not found"
449424
}
450-
shell: pwsh
451425
452426
- name: Clean Yui-patch
453427
run: |
@@ -467,7 +441,6 @@ jobs:
467441
} else {
468442
Write-Host "Source Server Folder not found"
469443
}
470-
shell: pwsh
471444
472445
- name: Set patch server port (in main.js of server)
473446
run: |

0 commit comments

Comments
 (0)