Skip to content

Commit 84a6420

Browse files
ci(release): support Lix GitHub asset URLs
1 parent b486571 commit 84a6420

4 files changed

Lines changed: 27 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ The body is text, not XML or HXX. Haxe generics such as `Assigns<T>`, comparison
5050
Install the immutable, versioned GitHub Release asset with [Lix](https://github.com/lix-pm/lix.client):
5151

5252
```bash
53-
lix install https://github.com/fullofcaffeine/herex/releases/download/v1.0.1/herex-1.0.1.zip
53+
lix install https://www.github.com/fullofcaffeine/herex/releases/download/v1.0.1/herex-1.0.1.zip
5454
```
5555

56+
Keep the `www` in this command. Lix 17 currently mistakes bare `github.com` Release URLs for repository sources; GitHub's `www` endpoint reaches the same immutable asset through Lix's HTTPS installer. Every release verifies this exact path by compiling a clean consumer.
57+
5658
Then add one line to the project HXML:
5759

5860
```hxml

RELEASING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ The release workflow:
1212

1313
Herex is not submitted to the Haxelib registry. The supported installation source is the immutable GitHub Release asset.
1414

15+
The public Lix smoke test rewrites GitHub API asset URLs from `github.com` to `www.github.com`. This is intentional: Lix 17 intercepts the bare host as a repository source and rejects Release asset paths before its generic HTTPS installer can handle them. Both hosts serve the same immutable GitHub asset.
16+
1517
Published `v*` tags and release assets are immutable. The reviewer-protected `release-repair` workflow may finish an incomplete draft for an existing protected tag; it must never move a tag, derive a new version, or replace a published asset.

scripts/ci/validate-policy.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,18 @@ requireCondition(read("extraParams.hxml").trim() === "--macro herex.HeredocSynta
2929
requireIncludes(read("haxe_libraries/formatter.hxml"), "formatter#1.18.0", "The formatter lock must remain exact");
3030

3131
const readme = read("README.md");
32-
requireIncludes(readme, "releases/download/v1.0.1/herex-1.0.1.zip", "README must lead with the first installable versioned GitHub Release asset");
32+
requireIncludes(
33+
readme,
34+
"https://www.github.com/fullofcaffeine/herex/releases/download/v1.0.1/herex-1.0.1.zip",
35+
"README must lead with the Lix-compatible versioned GitHub Release asset",
36+
);
3337
requireIncludes(readme, "-lib herex", "README must document one-line project activation");
3438
requireIncludes(readme, "<hd", "README must document the compact built-in alias");
3539
requireIncludes(read("AGENTS.example.md"), "Do not mechanically convert", "Agent guidance must preserve the heredoc/concatenation balance");
3640

41+
const lixSmoke = read("scripts/release/lix-consumer-smoke.mjs");
42+
requireIncludes(lixSmoke, 'parsed.hostname = "www.github.com"', "Public Lix verification must avoid Lix 17's bare GitHub host interceptor");
43+
3744
const releaseConfiguration = read("release.config.mjs");
3845
requireIncludes(releaseConfiguration, 'path: "artifacts/herex-*.zip"', "GitHub release assets must use glob paths supported by the publisher");
3946
requireCondition(!releaseConfiguration.includes('path: "artifacts/herex-${'), "GitHub release asset paths must not contain uninterpreted templates");

scripts/release/lix-consumer-smoke.mjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,29 @@ http.get = function patchedGet(options, ...rest) {
8585
NODE_OPTIONS: `${process.env.NODE_OPTIONS ?? ""} --require=${localPortPatch}`.trim(),
8686
};
8787
}
88-
await run(process.execPath, [lixEntry, "install", url], temporaryDirectory, installEnvironment);
88+
const installUrl = lixInstallUrl(url);
89+
await run(process.execPath, [lixEntry, "install", installUrl], temporaryDirectory, installEnvironment);
8990
await run(process.execPath, [lixEntry, "download"], temporaryDirectory);
9091
await run(process.execPath, [haxeEntry, "build.hxml"], temporaryDirectory);
91-
process.stdout.write(`Lix installed and compiled ${archivePath == null ? url : path.basename(archivePath)} using only -lib herex\n`);
92+
process.stdout.write(`Lix installed and compiled ${archivePath == null ? installUrl : path.basename(archivePath)} using only -lib herex\n`);
9293
} finally {
9394
if (server.listening) {
9495
await new Promise((resolve) => server.close(resolve));
9596
}
9697
rmSync(temporaryDirectory, {recursive: true, force: true});
9798
}
9899

100+
function lixInstallUrl(url) {
101+
const parsed = new URL(url);
102+
// Lix 17 case-sensitively intercepts bare github.com URLs as repository
103+
// sources before its generic HTTPS resolver. Release asset paths then fail
104+
// that repository parser. GitHub's www host serves the same immutable asset.
105+
if (parsed.protocol === "https:" && parsed.hostname === "github.com") {
106+
parsed.hostname = "www.github.com";
107+
}
108+
return parsed.toString();
109+
}
110+
99111
function run(command, args, cwd, env = process.env) {
100112
return new Promise((resolve, reject) => {
101113
const child = spawn(command, args, {cwd, env, stdio: "inherit"});

0 commit comments

Comments
 (0)