Skip to content

Commit b544ee3

Browse files
committed
new: Allow moon to be manually installed.
1 parent b6e638b commit b544ee3

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.3.1
2+
3+
- moon can be forced installed by setting `moon-version`, instead of relying on file detection.
4+
15
# 0.3.0
26

37
- Now includes the moon and proto versions in the cache key.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A GitHub action that sets up an environment for proto and moon.
44

55
- Installs `proto` globally so that installed tools can also be executed globally.
66
- Conditionally installs `moon` globally if the repository is using moon (attempts to detect a
7-
`.moon` directory).
7+
`.moon` directory), or `moon-version` is set.
88
- Caches the toolchain (`~/.proto`) so subsequent runs are faster.
99
- Hashes `.prototools` and `.moon/toolchain.yml` files to generate a unique cache key.
1010
- Cleans the toolchain before caching to remove unused or stale tools.
@@ -33,8 +33,7 @@ jobs:
3333
- `cache` - Toggle caching of the toolchain directory. Defaults to `true`.
3434
- `cache-base` - Base branch/ref to save a warmup cache on. Other branches/refs will restore from
3535
this base.
36-
- `moon-version` - Version of moon to explicitly install (if repository is using moon). Defaults to
37-
"latest".
38-
- `proto-version` - Version of proto to explicitly install. Defaults to "latest".
36+
- `moon-version` - Version of moon to explicitly install.
37+
- `proto-version` - Version of proto to explicitly install.
3938
- `workspace-root` - Relative path to moon's workspace root if initialized in a sub-directory.
4039
Defaults to "".

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ inputs:
1212
description:
1313
'Base branch/ref to save a warmup cache on. Other branches/refs will restore from this base.'
1414
moon-version:
15-
default: 'latest'
16-
description: 'Version of moon to install (if repository is using moon).'
15+
default: ''
16+
description: 'Version of moon to install.'
1717
required: false
1818
proto-version:
19-
default: 'latest'
19+
default: ''
2020
description: 'Version of proto to install.'
2121
required: false
2222
workspace-root:

helpers.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ export function isCacheEnabled() {
5151
}
5252

5353
export function isUsingMoon() {
54-
return fs.existsSync(path.join(getWorkingDir(), core.getInput('workspace-root'), '.moon'));
54+
return (
55+
!!core.getInput('moon-version') ||
56+
fs.existsSync(path.join(getWorkingDir(), core.getInput('workspace-root'), '.moon'))
57+
);
5558
}
5659

5760
export function extractMajorMinor(version: string) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@moonrepo/setup-toolchain",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "A GitHub action to setup and cache the proto and moon toolchains.",
55
"main": "dist/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)