删除无用代码,修改安装路径
All checks were successful
Continuous Integration / GitHub Actions Test (push) Successful in 30s

This commit is contained in:
walker 2024-03-18 13:51:49 +08:00
parent f27ab75da9
commit 1dd8cf04c9
5 changed files with 6 additions and 9 deletions

View File

@ -29,4 +29,4 @@ jobs:
- name: Print Output - name: Print Output
id: output id: output
run: echo "${{ steps.test-action.outputs.go-version }}" run: echo "${{ steps.test-action.outputs.version }}"

BIN
dist/index.js generated vendored

Binary file not shown.

BIN
dist/index.js.map generated vendored

Binary file not shown.

View File

@ -5,9 +5,6 @@ import os from 'os'
const DownloadBaseUrl = 'https://joylink.club/public-files/docker/' const DownloadBaseUrl = 'https://joylink.club/public-files/docker/'
export function getFileName(version: string, arch = os.arch()): string { export function getFileName(version: string, arch = os.arch()): string {
if (!version) {
version = 'v0.13.1'
}
return `buildx-${version}.linux-${arch}` return `buildx-${version}.linux-${arch}`
} }
@ -18,7 +15,7 @@ export function getFileName(version: string, arch = os.arch()): string {
*/ */
export async function download(fileName: string): Promise<string> { export async function download(fileName: string): Promise<string> {
const downloadUrl = `${DownloadBaseUrl}${fileName}` const downloadUrl = `${DownloadBaseUrl}${fileName}`
core.info(`Downloading go from ${downloadUrl}`) core.info(`Downloading docker buildx from ${downloadUrl}`)
const downloadPath = await tc.downloadTool(downloadUrl) const downloadPath = await tc.downloadTool(downloadUrl)
return downloadPath return downloadPath
} }

View File

@ -7,7 +7,7 @@ import path from 'path'
import cp from 'child_process' import cp from 'child_process'
import { getFileName, download } from './install' import { getFileName, download } from './install'
const BinDir = '/denv/docker/bin' const BinDir = '/denv/docker-plugin'
const BinName = 'buildx' const BinName = 'buildx'
/** /**
@ -18,8 +18,7 @@ export async function run(): Promise<void> {
try { try {
// 获取输入的version // 获取输入的version
const version: string = resolveVersionInput() const version: string = resolveVersionInput()
// Debug logs are only output if the `ACTIONS_STEP_DEBUG` secret is true core.debug(`The version is: ${version}`)
core.debug(`The input version is: ${version}`)
// 获取输入的architecture // 获取输入的architecture
let arch = core.getInput('architecture') let arch = core.getInput('architecture')
if (!arch) { if (!arch) {
@ -71,6 +70,7 @@ function resolveVersionInput(): string {
if (version) { if (version) {
return version return version
} else {
return 'v0.13.1'
} }
throw new Error(`没有指定版本`)
} }