Skip to content

Commit bd69bfd

Browse files
committed
Allow "latest" Shards on Windows and default to it
1 parent e583d28 commit bd69bfd

File tree

5 files changed

+17
-23
lines changed

5 files changed

+17
-23
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
- {}
1818
- {shards: false}
1919
- {shards: true}
20-
- {shards: '0.12.0', crystal: '0.35.1'}
20+
- {shards: '0.13.0', crystal: '0.35.1'}
2121
- {shards: latest, crystal: latest}
2222
- {shards: nightly, crystal: nightly}
2323
exclude:
2424
- os: windows-latest
25-
config: {shards: '0.12.0', crystal: '0.35.1'}
25+
config: {shards: '0.13.0', crystal: '0.35.1'}
2626
- os: windows-latest
2727
config: {shards: latest, crystal: latest}
2828

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
- {}
1818
- {shards: false}
1919
- {shards: true}
20-
- {shards: '0.12.0', crystal: '0.35.1'}
20+
- {shards: '0.13.0', crystal: '0.35.1'}
2121
- {shards: latest, crystal: latest}
2222
- {shards: nightly, crystal: nightly}
2323
exclude:
2424
- os: windows-latest
25-
config: {shards: '0.12.0', crystal: '0.35.1'}
25+
config: {shards: '0.13.0', crystal: '0.35.1'}
2626
- os: windows-latest
2727
config: {shards: latest, crystal: latest}
2828

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ Alternatively, you can use the container-based approach [as in the starter workf
5454

5555
* * **`shards: true`** (default)
5656

57-
Ensure that *some* released version of [Shards][] is available (or `nightly` on Windows).
57+
Ensure that *some* released version of [Shards][] is available.
5858
This uses the build that's bundled with Crystal's releases. Other options are slower, as building Shards is a necessary step then.
59-
60-
* **`shards: false`** (default on Windows)
61-
59+
60+
* **`shards: false`**
61+
6262
Ensure that `shards` executable is *not* available.
6363

64-
* **`shards: latest`** (not supported on Windows)
64+
* **`shards: latest`**
6565

6666
Build and install the latest released version of Shards.
6767

68-
* **`shards: 0.12.0`** (not supported on Windows)
68+
* **`shards: 0.13.0`**
6969

7070
Build and install a particular release of Shards.
7171

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Install Crystal
22
description: Install Crystal programming language
33
inputs:
44
crystal:
5-
description: The version of Crystal to install ("latest", "nightly", "0.34.0" etc)
5+
description: The version of Crystal to install ("latest", "nightly", "0.35.1" etc)
66
shards:
7-
description: The version of Shards to install (true, "latest", "nightly", "0.12.0" etc)
7+
description: The version of Shards to install (true, "latest", "nightly", "0.13.0" etc)
88
arch:
99
description: The architecture of the build of Crystal ("x86_64")
1010
destination:

index.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const execFile = Util.promisify(ChildProcess.execFile);
1414
async function run() {
1515
try {
1616
const params = getPlatform() === Windows ?
17-
{crystal: "nightly", shards: "false"} :
17+
{crystal: "nightly", shards: "true"} :
1818
{crystal: "latest", shards: "true"};
1919
for (const key of ["crystal", "shards", "arch", "destination"]) {
2020
let value;
@@ -161,11 +161,9 @@ async function installBinaryRelease({crystal, suffix, destination}) {
161161
}
162162

163163
async function maybeInstallShards({shards, destination}, crystalPromise) {
164-
const allowed = [Nightly, NumericVersion, Any, None];
165-
if (getPlatform() !== Windows) {
166-
allowed.push(Latest);
167-
} else if (shards === Any) {
168-
shards = Nightly;
164+
const allowed = [Latest, Nightly, NumericVersion, Any, None];
165+
if (getPlatform() === Windows && shards === Any) {
166+
shards = Latest;
169167
}
170168
checkVersion(shards, allowed);
171169
if (![Any, None].includes(shards)) {
@@ -294,11 +292,7 @@ async function downloadCrystalNightly(suffix, destination = null) {
294292
return onlySubdir(await ToolCache.extractTar(downloadedPath, destination));
295293
}
296294

297-
async function installCrystalForWindows({
298-
crystal = Nightly,
299-
arch = "x86_64",
300-
destination = null,
301-
}) {
295+
async function installCrystalForWindows({crystal, arch = "x86_64", destination = null}) {
302296
checkVersion(crystal, [Nightly]);
303297
checkArch(arch, ["x86_64"]);
304298
const path = await downloadCrystalNightlyForWindows(destination);

0 commit comments

Comments
 (0)