Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.6.1

- Fixed an issue with proto v0.55 installs.
- Updated to use githubusercontent.com instead of moonrepo.dev for script downloads.
- Updated dependencies.

# 0.6.0

- Added a `auto-setup` input that will automatically setup moon toolchains by running `moon setup`.
Expand Down
6 changes: 3 additions & 3 deletions helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export async function getToolchainCacheKey() {
return `${getCacheKeyPrefix()}-${process.platform}-${process.arch}-${hasher.digest('hex')}`;
}

function getProtoVersion(): string {
export function getProtoVersion(): string {
const version = core.getInput('proto-version');

if (version) {
Expand All @@ -174,7 +174,7 @@ function getProtoVersion(): string {
return 'latest';
}

function getMoonVersion(): string {
export function getMoonVersion(): string {
return core.getInput('moon-version') || 'latest';
}

Expand All @@ -195,7 +195,7 @@ export async function installBin(bin: string) {

core.info('Downloading installation script');

const script = await tc.downloadTool(`https://moonrepo.dev/install/${scriptName}`, scriptPath);
const script = await tc.downloadTool(`https://raw.githubusercontent.com/moonrepo/moon/refs/heads/master/website/static/install/${scriptName}`, scriptPath);

// eslint-disable-next-line no-magic-numbers
await fs.promises.chmod(script, 0o755);
Expand Down
8 changes: 8 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
getBinDir,
getCacheKeyPrefix,
getPluginsDir,
getProtoVersion,
getShimsDir,
getToolchainCacheKey,
getToolsDir,
Expand Down Expand Up @@ -64,6 +65,13 @@ async function run() {
core.info('Installing proto tools');

await execa('proto', ['install'], { cwd: getWorkspaceRoot(), stdio: 'inherit' });

// Temporary fix for a bug in v0.55!
const version = getProtoVersion();

if (version === 'latest' || version.startsWith('0.55')) {
await execa('proto', ['regen', '--bin'], { cwd: getWorkspaceRoot(), stdio: 'inherit' });
}
}

if (isUsingMoon() && core.getBooleanInput('auto-setup')) {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonrepo/setup-toolchain",
"version": "0.6.0",
"version": "0.6.1",
"description": "A GitHub action to setup and cache the proto and moon toolchains.",
"main": "dist/index.js",
"scripts": {
Expand All @@ -19,10 +19,10 @@
"author": "Miles Johnson",
"license": "MIT",
"dependencies": {
"@actions/cache": "^4.0.5",
"@actions/core": "^1.11.1",
"@actions/glob": "^0.5.0",
"@actions/tool-cache": "^2.0.2",
"@actions/cache": "^5.0.5",
"@actions/core": "^2.0.3",
"@actions/glob": "^0.5.1",
"@actions/tool-cache": "^3.0.1",
"execa": "^5.1.1",
"yaml": "^2.8.1"
},
Expand Down
Loading