Skip to content

Commit 1219d2f

Browse files
committed
Merge commit '5f7f9ea0a30d8a5d00273e3baff5fd6869734a60'
2 parents 65029e7 + 5f7f9ea commit 1219d2f

File tree

3 files changed

+17
-35
lines changed

3 files changed

+17
-35
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
crystal eval 'puts "test" + "ing"' | grep 'testing'
4747
- run: |
4848
'${{ steps.install.outputs.path }}/bin/crystal' --version
49+
if: ${{ runner.os != 'Windows' }}
4950
- run: |
5051
ls '${{ steps.install.outputs.path }}/src/prelude.cr'
5152
- run: |

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
crystal eval 'puts "test" + "ing"' | grep 'testing'
4747
- run: |
4848
'${{ steps.install.outputs.path }}/bin/crystal' --version
49+
if: ${{ runner.os != 'Windows' }}
4950
- run: |
5051
ls '${{ steps.install.outputs.path }}/src/prelude.cr'
5152
- run: |

index.js

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -363,22 +363,10 @@ async function installCrystalForWindows({crystal, arch = "x86_64", path}) {
363363

364364
Core.info("Setting up environment for Crystal");
365365
const vars = await variablesForVCBuildTools();
366-
addPathToVars(vars, "PATH", Path.join(path, "bin"));
367-
addPathToVars(vars, "LIB", Path.join(path, "bin"));
368-
addPathToVars(vars, "CRYSTAL_PATH", Path.join(path, "src"));
369-
addPathToVars(vars, "CRYSTAL_PATH", "lib");
370366
for (const [k, v] of vars.entries()) {
371367
Core.exportVariable(k, v);
372368
}
373-
}
374-
375-
function addPathToVars(vars, key, value) {
376-
for (const [k, v] of vars.entries()) {
377-
if (k.toLowerCase() === key.toLowerCase()) {
378-
return vars.set(k, value + Path.delimiter + v);
379-
}
380-
}
381-
return vars.set(key, value);
369+
Core.addPath(path);
382370
}
383371

384372
const outputSep = "---";
@@ -424,28 +412,20 @@ async function downloadCrystalNightlyForWindows() {
424412
Core.info(`Found Crystal release ${workflowRun["html_url"]}`);
425413
Core.setOutput("crystal", ref);
426414

427-
const fetchSrcTask = downloadSource({name: "Crystal", apiBase: GitHubApiBase, ref});
428-
const fetchExeTask = (async () => {
429-
const artifactsResp = await githubGet({
430-
url: GitHubApiBase + "/actions/runs/:run_id/artifacts",
431-
"run_id": runId,
432-
});
433-
const artifact = artifactsResp.data["artifacts"].find((x) => x.name === "crystal");
434-
435-
Core.info("Downloading Crystal build");
436-
const downloadedPath = await githubDownloadViaRedirect({
437-
url: GitHubApiBase + "/actions/artifacts/:artifact_id/zip",
438-
"artifact_id": artifact.id,
439-
});
440-
441-
Core.info("Extracting Crystal build");
442-
return ToolCache.extractZip(downloadedPath);
443-
})();
444-
445-
const path = await fetchSrcTask;
446-
await IO.rmRF(Path.join(path, "bin"));
447-
await IO.mv(await fetchExeTask, Path.join(path, "bin"));
448-
return path;
415+
const artifactsResp = await githubGet({
416+
url: GitHubApiBase + "/actions/runs/:run_id/artifacts",
417+
"run_id": runId,
418+
});
419+
const artifact = artifactsResp.data["artifacts"].find((x) => x.name === "crystal");
420+
421+
Core.info("Downloading Crystal build");
422+
const downloadedPath = await githubDownloadViaRedirect({
423+
url: GitHubApiBase + "/actions/artifacts/:artifact_id/zip",
424+
"artifact_id": artifact.id,
425+
});
426+
427+
Core.info("Extracting Crystal build");
428+
return ToolCache.extractZip(downloadedPath);
449429
}
450430

451431
function githubGet(request) {

0 commit comments

Comments
 (0)