Skip to content

Commit

Permalink
Merge branch 'gmitch215/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe2 committed Feb 4, 2025
2 parents fdf030f + 24b4adc commit ad72826
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
14 changes: 7 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,30 @@ async function run(): Promise<void> {
if (installNative) {
const ktNativePath = await tc.downloadTool(nativeDownloadUrl(version))
core.debug(`Downloaded Kotlin Native ${version} to ${ktNativePath}`)
core.exportVariable('KOTLIN_NATIVE_HOME', ktNativePath)

const ktNativePathExtractedFolder = await extractNativeArchive(ktNativePath)
nativeCachedPath = await tc.cacheDir(ktNativePathExtractedFolder, 'kotlin-native', version)
}
}
}

const s = IS_WINDOWS ? '\\' : '/'

/*
The order of addPath call here matter because both archives have a "kotlinc" binary.
*/
if (installNative) {
const nativePath = `${nativeCachedPath}/kotlin-native-prebuilt-${osName()}-${osArch()}-${version}`
core.addPath(`${nativePath}/bin`)
const nativePath = `${nativeCachedPath}${s}kotlin-native-prebuilt-${osName()}-${osArch()}-${version}`
core.addPath(`${nativePath}${s}bin`)
core.exportVariable('KOTLIN_NATIVE_HOME', nativePath)
core.debug(`Added ${nativePath}/bin to PATH`)
core.debug(`Added ${nativePath}${s}bin to PATH`)
await exec.exec('kotlinc-native', ['-version'])
}

const kotlinPath = `${cachedPath}/kotlinc`
core.addPath(`${kotlinPath}/bin`)
const kotlinPath = `${cachedPath}${s}kotlinc`
core.addPath(`${kotlinPath}${s}bin`)
core.exportVariable('KOTLIN_HOME', kotlinPath)
core.debug(`Added ${kotlinPath}/bin to PATH`)
core.debug(`Added ${kotlinPath}${s}bin to PATH`)
await exec.exec('kotlinc', ['-version'])

const script = core.getInput('script')
Expand Down

0 comments on commit ad72826

Please sign in to comment.