From 9d06e8f6efbfaa948f381cb740d76a51dbda235c Mon Sep 17 00:00:00 2001 From: k Date: Tue, 10 Feb 2026 10:36:09 +0100 Subject: [PATCH 1/5] Use nightly neko for nightly haxe --- src/asset.ts | 41 +++++++++++++++++++++++++++++++++++++---- src/setup.ts | 2 +- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/asset.ts b/src/asset.ts index 39a3894..712dbeb 100644 --- a/src/asset.ts +++ b/src/asset.ts @@ -139,22 +139,34 @@ abstract class Asset { // * NOTE https://github.com/HaxeFoundation/neko/releases/download/v2-4-0/neko-2.4.0-osx-universal.tar.gz // * NOTE https://github.com/HaxeFoundation/neko/releases/download/v2-4-0/neko-2.4.0-win64.zip export class NekoAsset extends Asset { - static resolveFromHaxeVersion(version: string) { + static resolveFromHaxeVersion(version: string, nightly: boolean) { + const env = new Env(); + + if (nightly) { + return new NekoAsset('latest', true, false, env); + } + // Haxe older than 4.3 has issues with mbedtls 3 in neko 2.4 const nekoVer = version.startsWith('3.') || (version.startsWith('4.') && version < '4.3.') ? '2.3.0' : '2.4.0'; - const env = new Env(); // Haxe 3 on windows has 32 bit haxelib, which requires 32 bit neko const force32 = version.startsWith('3.') && env.platform === 'win'; - return new NekoAsset(nekoVer, force32, env); + return new NekoAsset(nekoVer, false, force32, env); } - constructor(version: string, protected readonly force32: boolean, env = new Env()) { + nightly = false; + + constructor(version: string, nightly: boolean, protected readonly force32: boolean, env = new Env()) { super('neko', version, env); + this.nightly = nightly; } get downloadUrl() { + if (this.nightly) { + return `https://build.haxe.org/builds/neko/${this.nightlyTarget}/neko_${this.version}${this.fileExt}`; + } + const tag = `v${this.version.replace(/\./g, '-')}`; return super.makeDownloadUrl( `/neko/releases/download/${tag}/${this.fileNameWithoutExt}${this.fileExt}`, @@ -173,6 +185,27 @@ export class NekoAsset extends Asset { return `${this.env.platform}${this.env.arch}`; } + get nightlyTarget() { + const plat = this.env.platform; + switch (plat) { + case 'osx': { + return 'mac'; + } + + case 'linux': { + return 'linux64'; + } + + case 'win': { + return 'windows64'; + } + + default: { + throw new Error(`${plat} not supported`); // eslint-disable-line @typescript-eslint/restrict-template-expressions + } + } + } + get fileNameWithoutExt() { return `neko-${this.version}-${this.target}`; } diff --git a/src/setup.ts b/src/setup.ts index 20566e6..b3abac1 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -12,7 +12,7 @@ import { restoreHaxelib, createHaxelibKey } from './haxelib'; const env = new Env(); export async function setup(version: string, nightly: boolean, cacheDependencyPath: string) { - const neko = NekoAsset.resolveFromHaxeVersion(version); // Haxelib requires Neko + const neko = NekoAsset.resolveFromHaxeVersion(version, nightly); // Haxelib requires Neko const nekoPath = await neko.setup(); core.addPath(nekoPath); core.exportVariable('NEKOPATH', nekoPath); From 92dd29c8cbf59adde83dcbf9bb8abc4d8c738cbe Mon Sep 17 00:00:00 2001 From: k Date: Tue, 10 Feb 2026 10:36:15 +0100 Subject: [PATCH 2/5] [CI] print neko version too --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 126ba41..3bc8f8a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,6 +59,7 @@ jobs: haxe-version: ${{ matrix.haxe }} cache-dependency-path: 'test-workflow/${{ matrix.lib_hxml }}' + - run: neko -version - run: haxe -version - run: haxelib install test-workflow/${{ matrix.lib_hxml }} --always From 513d8676da01738004f114a187ebd8fdf9ca1c44 Mon Sep 17 00:00:00 2001 From: k Date: Tue, 10 Feb 2026 10:46:53 +0100 Subject: [PATCH 3/5] Update dist/index.js --- dist/index.js | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7648784..cbe17be 100644 --- a/dist/index.js +++ b/dist/index.js @@ -187,20 +187,28 @@ class Asset { // * NOTE https://github.com/HaxeFoundation/neko/releases/download/v2-4-0/neko-2.4.0-win64.zip class NekoAsset extends Asset { force32; - static resolveFromHaxeVersion(version) { + static resolveFromHaxeVersion(version, nightly) { + const env = new Env(); + if (nightly) { + return new NekoAsset('latest', true, false, env); + } // Haxe older than 4.3 has issues with mbedtls 3 in neko 2.4 const nekoVer = version.startsWith('3.') || (version.startsWith('4.') && version < '4.3.') ? '2.3.0' : '2.4.0'; - const env = new Env(); // Haxe 3 on windows has 32 bit haxelib, which requires 32 bit neko const force32 = version.startsWith('3.') && env.platform === 'win'; - return new NekoAsset(nekoVer, force32, env); + return new NekoAsset(nekoVer, false, force32, env); } - constructor(version, force32, env = new Env()) { + nightly = false; + constructor(version, nightly, force32, env = new Env()) { super('neko', version, env); this.force32 = force32; + this.nightly = nightly; } get downloadUrl() { + if (this.nightly) { + return `https://build.haxe.org/builds/neko/${this.nightlyTarget}/neko_${this.version}${this.fileExt}`; + } const tag = `v${this.version.replace(/\./g, '-')}`; return super.makeDownloadUrl(`/neko/releases/download/${tag}/${this.fileNameWithoutExt}${this.fileExt}`); } @@ -213,6 +221,23 @@ class NekoAsset extends Asset { } return `${this.env.platform}${this.env.arch}`; } + get nightlyTarget() { + const plat = this.env.platform; + switch (plat) { + case 'osx': { + return 'mac'; + } + case 'linux': { + return 'linux64'; + } + case 'win': { + return 'windows64'; + } + default: { + throw new Error(`${plat} not supported`); // eslint-disable-line @typescript-eslint/restrict-template-expressions + } + } + } get fileNameWithoutExt() { return `neko-${this.version}-${this.target}`; } @@ -366,7 +391,7 @@ async function saveHaxelib() { const env = new Env(); async function setup(version, nightly, cacheDependencyPath) { - const neko = NekoAsset.resolveFromHaxeVersion(version); // Haxelib requires Neko + const neko = NekoAsset.resolveFromHaxeVersion(version, nightly); // Haxelib requires Neko const nekoPath = await neko.setup(); lib_core.addPath(nekoPath); lib_core.exportVariable('NEKOPATH', nekoPath); From ce2138d601b6a25e1ea16ced256c82df6d56941f Mon Sep 17 00:00:00 2001 From: k Date: Tue, 10 Feb 2026 10:49:37 +0100 Subject: [PATCH 4/5] Use mac-universal nightlies for neko --- dist/index.js | 2 +- src/asset.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index cbe17be..a8a04b4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -225,7 +225,7 @@ class NekoAsset extends Asset { const plat = this.env.platform; switch (plat) { case 'osx': { - return 'mac'; + return 'mac-universal'; } case 'linux': { return 'linux64'; diff --git a/src/asset.ts b/src/asset.ts index 712dbeb..b874496 100644 --- a/src/asset.ts +++ b/src/asset.ts @@ -189,7 +189,7 @@ export class NekoAsset extends Asset { const plat = this.env.platform; switch (plat) { case 'osx': { - return 'mac'; + return 'mac-universal'; } case 'linux': { From d6b5525c99eba1a4210006d285553bc4625d6483 Mon Sep 17 00:00:00 2001 From: k Date: Thu, 19 Feb 2026 21:33:34 +0100 Subject: [PATCH 5/5] Try to handle nightlies with / in branch name --- dist/index.js | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index a8a04b4..d5dc13e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -23,7 +23,7 @@ async function main() { try { const inputVersion = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('haxe-version'); const cacheDependencyPath = _actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput('cache-dependency-path'); - const nightly = /^(\d{4}-\d{2}-\d{2}_[\w.-]+_\w+)|latest$/.test(inputVersion); + const nightly = /^(\d{4}-\d{2}-\d{2}_[\w./-]+_\w+)|latest$/.test(inputVersion); const version = nightly ? inputVersion : semver__WEBPACK_IMPORTED_MODULE_1__.valid(semver__WEBPACK_IMPORTED_MODULE_1__.clean(inputVersion)); if (version) { await (0,_setup__WEBPACK_IMPORTED_MODULE_2__/* .setup */ .c)(version, nightly, cacheDependencyPath); diff --git a/src/main.ts b/src/main.ts index 4812dbc..e50c810 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,7 +11,7 @@ async function main(): Promise { try { const inputVersion = core.getInput('haxe-version'); const cacheDependencyPath = core.getInput('cache-dependency-path'); - const nightly = /^(\d{4}-\d{2}-\d{2}_[\w.-]+_\w+)|latest$/.test(inputVersion); + const nightly = /^(\d{4}-\d{2}-\d{2}_[\w./-]+_\w+)|latest$/.test(inputVersion); const version = nightly ? inputVersion : semver.valid(semver.clean(inputVersion)); if (version) { await setup(version, nightly, cacheDependencyPath);