Skip to content

Commit

Permalink
Reference the new releases URLs (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekthompson authored Feb 7, 2023
1 parent 6881eaa commit faf31d2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
9 changes: 7 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6560,6 +6560,7 @@ const tc = __nccwpck_require__(7784);
function run() {
return __awaiter(this, void 0, void 0, function* () {
let version = core.getInput('version');
let extension = '';
if (version === 'latest') {
version = 'v1';
}
Expand All @@ -6569,12 +6570,16 @@ function run() {
let os = process.platform;
if (os === 'win32') {
os = 'windows';
extension = '.exe';
}
let arch = process.arch;
if (arch === 'x64') {
arch = 'amd64';
arch = 'x86_64';
}
const url = `https://releases.captain.build/captain-${os}-${arch}-${version}`;
else if (arch === 'arm64') {
arch = 'aarch64';
}
const url = `https://releases.captain.build/${version}/${os}/${arch}/captain${extension}`;
core.debug(`Fetching ${url}`);
const captain = yield tc.downloadTool(url);
core.debug('Installing to /usr/local/bin/captain');
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-captain",
"version": "1.1.6",
"version": "1.1.7",
"description": "This action installs the captain CLI in Github Actions",
"main": "dist/index.js",
"scripts": {
Expand Down
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as core from '@actions/core'
import * as exec from '@actions/exec'
import * as http from '@actions/http-client'
import * as tc from '@actions/tool-cache'

async function run() {
let version = core.getInput('version')
let extension = ''

if (version === 'latest') {
version = 'v1'
Expand All @@ -17,14 +17,17 @@ async function run() {
let os = process.platform as string
if (os === 'win32') {
os = 'windows'
extension = '.exe'
}

let arch = process.arch as string
if (arch === 'x64') {
arch = 'amd64'
arch = 'x86_64'
} else if (arch === 'arm64') {
arch = 'aarch64'
}

const url = `https://releases.captain.build/captain-${os}-${arch}-${version}`
const url = `https://releases.captain.build/${version}/${os}/${arch}/captain${extension}`

core.debug(`Fetching ${url}`)
const captain = await tc.downloadTool(url)
Expand Down

0 comments on commit faf31d2

Please sign in to comment.