-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Y0sh1dk/feature/ci-testing
Build and commit binaries in CI
- Loading branch information
Showing
12 changed files
with
89 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
bin | ||
# Need bin/ | ||
# bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: gha-docker-image-exists | ||
description: Check if a docker image exists | ||
|
||
runs: | ||
using: node16 | ||
main: shim.js |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const childProcess = require('child_process') | ||
const os = require('os') | ||
const process = require('process') | ||
|
||
function chooseBinary() { | ||
const platform = os.platform() | ||
const arch = os.arch() | ||
|
||
if (platform === 'linux' && arch === 'x64') { | ||
return `gha-docker-image-exists-linux-amd64` | ||
} | ||
if (platform === 'linux' && arch === 'arm64') { | ||
return `gha-docker-image-exists-linux-arm64` | ||
} | ||
if (platform === 'windows' && arch === 'x64') { | ||
return `gha-docker-image-exists-windows-amd64` | ||
} | ||
if (platform === 'windows' && arch === 'arm64') { | ||
return `gha-docker-image-exists-windows-arm64` | ||
} | ||
if (platform === 'darwin' && arch === 'x64') { | ||
return `gha-docker-image-exists-darwin-amd64` | ||
} | ||
if (platform === 'darwin' && arch === 'arm64') { | ||
return `gha-docker-image-exists-darwin-arm64` | ||
} | ||
|
||
console.error(`Unsupported platform (${platform}) and architecture (${arch})`) | ||
process.exit(1) | ||
} | ||
|
||
function main() { | ||
const binary = chooseBinary() | ||
const mainScript = `${__dirname}/bin/${binary}` | ||
const spawnSyncReturns = childProcess.spawnSync(mainScript, { stdio: 'inherit' }) | ||
const status = spawnSyncReturns.status | ||
if (typeof status === 'number') { | ||
process.exit(status) | ||
} | ||
process.exit(1) | ||
} | ||
|
||
if (require.main === module) { | ||
main() | ||
} |