Skip to content

Commit 9111cf8

Browse files
authored
Revert "Node toPy"
1 parent 8f7f726 commit 9111cf8

File tree

10 files changed

+938
-101
lines changed

10 files changed

+938
-101
lines changed

.github/workflows/cp__latest_dispatch.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,38 @@ jobs:
1010
scraped_version: ${{ steps.set_scraped_version.outputs.scraped_version }}
1111

1212
env:
13-
PYTHON_VERSION: 3.12.6
13+
NODE_JS_VERSION: 22.9.0
1414

1515
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v4
16+
- uses: actions/checkout@v4
17+
18+
- name: Use Node.js ${{ env.NODE_JS_VERSION }}
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ env.NODE_JS_VERSION }}
1822

19-
- name: Setup Python ${{ env.PYTHON_VERSION }}
20-
uses: actions/setup-python@v5
23+
- name: Cache Node.js dependencies
24+
uses: actions/cache@v4
2125
with:
22-
python-version: ${{ env.PYTHON_VERSION }}
26+
path: utils/fe-version-scraper/node_modules
27+
key: ${{ runner.os }}-node-${{ env.NODE_JS_VERSION }}-${{ hashFiles('utils/fe-version-scraper/package-lock.json') }}
28+
restore-keys: |
29+
${{ runner.os }}-node-${{ env.NODE_JS_VERSION }}-
2330
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install requests beautifulsoup4
31+
- name: Install Node.js dependencies
32+
run: npm ci
33+
working-directory: utils/fe-version-scraper
34+
35+
- name: Run the Node.js script
36+
run: node .
37+
working-directory: utils/fe-version-scraper
2838

29-
- name: Run Python Script
30-
run: python utils/fe-version-scraper/fe-version-scraper.py --latest
31-
3239
- name: Read & Set Env
3340
id: set_scraped_version
34-
shell: pwsh
3541
run: |
3642
$fileContent = Get-Content -Path "utils/fe-version-scraper/latest_version.txt" -Raw
3743
echo "scraped_version=$fileContent" | Out-File -Append -FilePath $env:GITHUB_OUTPUT
38-
44+
3945
download-yukihana-patch:
4046
runs-on: windows-latest
4147
needs:

.github/workflows/cp_dispatch.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,37 @@ jobs:
1919
is_valid: ${{ steps.get_validity.outputs.is_valid }}
2020

2121
env:
22-
PYTHON_VERSION: 3.12.6
22+
NODE_JS_VERSION: 22.9.0
2323

2424
steps:
25-
- name: Checkout repository
26-
uses: actions/checkout@v4
25+
- uses: actions/checkout@v4
26+
27+
- name: Use Node.js ${{ env.NODE_JS_VERSION }}
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ env.NODE_JS_VERSION }}
2731

28-
- name: Setup Python ${{ env.PYTHON_VERSION }}
29-
uses: actions/setup-python@v5
32+
- name: Cache Node.js dependencies
33+
uses: actions/cache@v4
3034
with:
31-
python-version: ${{ env.PYTHON_VERSION }}
35+
path: utils/fe-version-validator/node_modules
36+
key: ${{ runner.os }}-node-${{ env.NODE_JS_VERSION }}-${{ hashFiles('utils/fe-version-validator/package-lock.json') }}
37+
restore-keys: |
38+
${{ runner.os }}-node-${{ env.NODE_JS_VERSION }}-
3239
33-
- name: Install dependencies
34-
run: |
35-
python -m pip install --upgrade pip
36-
pip install requests beautifulsoup4
40+
- name: Install Node.js dependencies
41+
run: npm ci
42+
working-directory: utils/fe-version-validator
43+
44+
- name: Run the Node.js script
45+
run: node .
46+
working-directory: utils/fe-version-validator
3747

38-
- name: Run Python Script
39-
run: python utils/fe-version-scraper/fe-version-scraper.py --all
40-
4148
- name: Get Version Validity
4249
id: get_validity
4350
shell: pwsh
4451
run: |
45-
$filePath = "utils/fe-version-scraper/versions.txt"
52+
$filePath = "utils/fe-version-validator/versions.txt"
4653
$isValid = 'false'
4754
$patchingVersion = $env:VERSION_TO_PATCH
4855

.github/workflows/cp_main.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,31 @@ jobs:
1818
scraped_version: ${{ steps.set_scraped_version.outputs.scraped_version }}
1919

2020
env:
21-
PYTHON_VERSION: 3.12.6
21+
NODE_JS_VERSION: 22.9.0
2222

2323
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v4
24+
- uses: actions/checkout@v4
2625

27-
- name: Setup Python ${{ env.PYTHON_VERSION }}
28-
uses: actions/setup-python@v5
26+
- name: Use Node.js ${{ env.NODE_JS_VERSION }}
27+
uses: actions/setup-node@v4
2928
with:
30-
python-version: ${{ env.PYTHON_VERSION }}
29+
node-version: ${{ env.NODE_JS_VERSION }}
3130

32-
- name: Install dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install requests beautifulsoup4
36-
37-
- name: Run Python Script
38-
run: python utils/fe-version-scraper/fe-version-scraper.py --latest
31+
- name: Cache Node.js dependencies
32+
uses: actions/cache@v4
33+
with:
34+
path: utils/fe-version-scraper/node_modules
35+
key: ${{ runner.os }}-node-${{ env.NODE_JS_VERSION }}-${{ hashFiles('utils/fe-version-scraper/package-lock.json') }}
36+
restore-keys: |
37+
${{ runner.os }}-node-${{ env.NODE_JS_VERSION }}-
38+
39+
- name: Install Node.js dependencies
40+
run: npm ci
41+
working-directory: utils/fe-version-scraper
42+
43+
- name: Run the Node.js script
44+
run: node .
45+
working-directory: utils/fe-version-scraper
3946

4047
- name: Read & Set Env
4148
id: set_scraped_version
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const axios = require('axios');
2+
const cheerio = require('cheerio');
3+
const fs = require('fs');
4+
5+
async function getLatestVersion() {
6+
try {
7+
const url = 'https://www.telerik.com/support/whats-new/fiddler-everywhere/release-history';
8+
const { data } = await axios.get(url);
9+
10+
const $ = cheerio.load(data);
11+
12+
// Adjust the selector to match the layout of the page
13+
const version = $('a:contains("Fiddler Everywhere v")')
14+
.first()
15+
.text()
16+
.match(/(\d+\.\d+\.\d+)/)[0]; // Update regex to capture version without 'v'
17+
18+
console.log(`Latest Version: ${version}`);
19+
20+
// Save the version to a file
21+
fs.writeFileSync('latest_version.txt', version);
22+
} catch (error) {
23+
console.error('Error fetching version:', error);
24+
}
25+
}
26+
27+
getLatestVersion();

utils/fe-version-scraper/fe-version-scraper.py

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)