Skip to content

Commit 850513e

Browse files
committed
Actually set the 'path' output, expand CI
1 parent c1a5c4e commit 850513e

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ jobs:
3737
- uses: ./
3838
with: ${{ matrix.config }}
3939
id: install
40+
- run: |
41+
echo 'crystal "${{ steps.install.outputs.crystal }}" | shards "${{ steps.install.outputs.shards }}"'
4042
4143
- run: |
4244
crystal eval 'puts "test" + "ing"' | grep 'testing'
4345
- run: |
44-
crystal --version
46+
'${{ steps.install.outputs.path }}/bin/crystal' --version
47+
- run: |
48+
ls '${{ steps.install.outputs.path }}/src/prelude.cr'
4549
- run: |
4650
v='${{ steps.install.outputs.crystal }}'
4751
crystal --version | grep "${v:0:9}"

.github/workflows/release.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,15 @@ jobs:
3737
- uses: oprypin/install-crystal@v1
3838
with: ${{ matrix.config }}
3939
id: install
40+
- run: |
41+
echo 'crystal "${{ steps.install.outputs.crystal }}" | shards "${{ steps.install.outputs.shards }}"'
4042
4143
- run: |
4244
crystal eval 'puts "test" + "ing"' | grep 'testing'
4345
- run: |
44-
crystal --version
46+
'${{ steps.install.outputs.path }}/bin/crystal' --version
47+
- run: |
48+
ls '${{ steps.install.outputs.path }}/src/prelude.cr'
4549
- run: |
4650
v='${{ steps.install.outputs.crystal }}'
4751
crystal --version | grep "${v:0:9}"

index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ async function run() {
3030
if (params.shards === Any && getPlatform() === Windows) {
3131
params.shards = Latest;
3232
}
33+
Core.setOutput("path", params.path);
3334

3435
const func = {
3536
[Linux]: installCrystalForLinux,
@@ -106,6 +107,7 @@ async function installCrystalForLinux({crystal, shards, arch = getArch(), path})
106107

107108
Core.info("Setting up environment for Crystal");
108109
Core.addPath(Path.join(path, "bin"));
110+
await FS.symlink("share/crystal/src", Path.join(path, "src"));
109111
if (shards === None) {
110112
try {
111113
await FS.unlink(Path.join(path, "bin", "shards"));
@@ -167,8 +169,14 @@ async function maybeInstallShards({shards, path}, crystalPromise) {
167169
await installShards({shards, path}, crystalPromise);
168170
}
169171
if (shards !== None) {
170-
await crystalPromise;
172+
if (shards === Any) {
173+
await crystalPromise;
174+
}
171175
const {stdout} = await subprocess(["shards", "--version"]);
176+
const [ver] = stdout.match(/\d[^ ]+/);
177+
if (shards === Any && ver) {
178+
Core.setOutput("shards", "v" + ver);
179+
}
172180
Core.info(stdout);
173181
}
174182
}

0 commit comments

Comments
 (0)