Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/check-sdk-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ jobs:
- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Fetch Chromium mac_toolchain.py
run: |
curl -sSL "https://chromium.googlesource.com/chromium/src/+/main/build/mac_toolchain.py?format=TEXT" | base64 -d > mac_toolchain.py

- name: Check for new SDK version
id: check-sdk
run: node .github/workflows/scripts/check-sdk-version.js mac_toolchain.py
run: node .github/workflows/scripts/check-sdk-version.mjs mac_toolchain.py

- name: Create issue for new SDK
if: steps.check-sdk.outputs.new-sdk == 'true'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#!/usr/bin/env node

const fs = require('fs');
const path = require('path');
const { extractSDKVersion } = require('../../../src/utils/sdk');
import * as fs from 'node:fs';

function getKnownSDKs() {
const sdkPath = path.resolve(__dirname, '../../../src/utils/sdks.json');
const sdks = JSON.parse(fs.readFileSync(sdkPath, 'utf8'));
return Object.keys(sdks);
}
import { extractSDKVersion } from '../../../dist/utils/sdk.js';
import SDKs from '../../../src/utils/sdks.json' with { type: 'json' };

function isNewerVersion(v1, v2) {
const [major1, minor1] = v1.split('.').map(Number);
Expand All @@ -26,7 +21,7 @@ function main() {

if (!macToolchainPath || !fs.existsSync(macToolchainPath)) {
console.error(`Error: Could not find ${macToolchainPath || 'mac_toolchain.py'}`);
console.error('Usage: node check-sdk-version.js <path-to-mac_toolchain.py>');
console.error('Usage: node check-sdk-version.mjs <path-to-mac_toolchain.py>');
process.exit(1);
}

Expand All @@ -38,7 +33,7 @@ function main() {
process.exit(1);
}

const knownSDKs = getKnownSDKs();
const knownSDKs = Object.keys(SDKs);
console.log(`Known SDK versions: ${knownSDKs.join(', ')}`);

if (knownSDKs.includes(chromiumSDK)) {
Expand Down