-
Notifications
You must be signed in to change notification settings - Fork 12
feature: Add multi architecture support #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
0b1e6f5
32c73f7
d5adb14
306619a
f9a8d9a
5e7d7dd
7013629
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
|
|
||
| Selfhosted runners do not come with the GH CLI out of the box. This action is an easy-to-use way to install it. | ||
|
|
||
| As of now, only linux amd64 is supported. | ||
| Supports arm64, amd64 and 386 architectures | ||
|
|
||
| ## Usage | ||
|
|
||
|
|
@@ -11,4 +11,5 @@ As of now, only linux amd64 is supported. | |
| uses: dev-hanz-ops/[email protected] | ||
| with: | ||
| gh-cli-version: 2.32.0 # optional, see action.yml for current default | ||
| gh-cli-architcture: amd64 # optional, see action.yml for current default | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,28 +5,30 @@ import * as path from 'path'; | |
| async function run() { | ||
| try { | ||
| let version = core.getInput('gh-cli-version'); | ||
| if (version) { | ||
| await getGhCli(version); | ||
| let architecture = core.getInput('gh-cli-arch'); | ||
|
||
| console.log(`Hello ${architecture}!`); | ||
| if (version && architecture) { | ||
| await getGhCli(version,architecture); | ||
dev-hanz-ops marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } catch (error) { | ||
| core.setFailed(error.message); | ||
| } | ||
| } | ||
|
|
||
| async function getGhCli(version) { | ||
| async function getGhCli(version,architecture) { | ||
| let toolPath = tc.find('gh-cli', version); | ||
|
|
||
| if (!toolPath) { | ||
| toolPath = await downloadGhCli(version); | ||
| toolPath = await downloadGhCli(version,architecture); | ||
| } | ||
|
|
||
| toolPath = path.join(toolPath, 'bin'); | ||
| core.addPath(toolPath); | ||
| } | ||
|
|
||
| async function downloadGhCli(version) { | ||
| const toolDirectoryName = `gh_${version}_linux_amd64`; | ||
| const downloadUrl = `https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz`; | ||
| async function downloadGhCli(version,architecture) { | ||
| const toolDirectoryName = `gh_${version}_linux_${architecture}`; | ||
| const downloadUrl = `https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_${architecture}.tar.gz`; | ||
| console.log(`downloading ${downloadUrl}`); | ||
|
|
||
| try { | ||
|
|
@@ -38,5 +40,4 @@ async function downloadGhCli(version) { | |
| throw err; | ||
| } | ||
| } | ||
|
|
||
| run(); | ||
Uh oh!
There was an error while loading. Please reload this page.