Skip to content

Commit

Permalink
feat: use new download endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Feb 5, 2023
1 parent ff0161d commit 1b14387
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ function getPlatformArch (a: string, p: string): string {
return (platform[p] ? platform[p] : p) + '/' + (arch[a] ? arch[a] : a)
}

async function installer (version? : string): Promise<string> {
core.info(`downloading semantic-release@${version || 'latest'}`)
const v = version ? `/${version}` : ''
const path = await tc.downloadTool(`https://get-release.xyz/semantic-release/${getPlatformArch(arch(), platform())}${v}`)
async function installLatestSemRelVersion (): Promise<string> {
core.info('downloading semantic-release binary...')
const path = await tc.downloadTool(`https://registry.go-semantic-release.xyz/downloads/${getPlatformArch(arch(), platform())}/semantic-release`)
await fs.chmod(path, '0755')
return path
}
Expand Down Expand Up @@ -83,7 +82,7 @@ async function main (): Promise<void> {
}

let binPath = core.getInput('bin')
if (!binPath) binPath = await installer()
if (!binPath) binPath = await installLatestSemRelVersion()

try {
core.info('running semantic-release...')
Expand Down

0 comments on commit 1b14387

Please sign in to comment.