mirror of https://github.com/actions/toolkit
Restructuring
parent
95cf02468e
commit
962fd91d75
|
@ -1,6 +1,6 @@
|
||||||
import { ArtifactClient, DefaultArtifactClient} from './internal/artifact-client'
|
import { ArtifactClient, DefaultArtifactClient} from './internal/internal-artifact-client'
|
||||||
import { UploadOptions } from './internal/upload-options'
|
import { UploadOptions } from './internal/upload/upload-options'
|
||||||
import { UploadResponse } from './internal/upload-response'
|
import { UploadResponse } from './internal/upload/upload-response'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exported functionality that we want to expose for any users of @actions/artifact
|
* Exported functionality that we want to expose for any users of @actions/artifact
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import {checkArtifactName} from './path-and-artifact-name-validation'
|
import { UploadOptions } from './upload/upload-options'
|
||||||
import {UploadOptions} from './upload-options'
|
import { UploadResponse } from './upload/upload-response'
|
||||||
import {UploadResponse} from './upload-response'
|
import { uploadArtifact } from './upload/upload-artifact'
|
||||||
|
|
||||||
export interface ArtifactClient {
|
export interface ArtifactClient {
|
||||||
/**
|
/**
|
||||||
|
@ -39,22 +39,6 @@ export class DefaultArtifactClient implements ArtifactClient {
|
||||||
rootDirectory: string,
|
rootDirectory: string,
|
||||||
options?: UploadOptions | undefined
|
options?: UploadOptions | undefined
|
||||||
): Promise<UploadResponse> {
|
): Promise<UploadResponse> {
|
||||||
|
return uploadArtifact(name, files, rootDirectory, options)
|
||||||
// Need to keep checking the artifact name
|
|
||||||
checkArtifactName(name)
|
|
||||||
|
|
||||||
// TODO Twirp call to create new artifact
|
|
||||||
|
|
||||||
// TODO Upload to blob storage using SAS URL
|
|
||||||
|
|
||||||
// TODO Twirp call to finalize the new artifact upload
|
|
||||||
|
|
||||||
const uploadResponse: UploadResponse = {
|
|
||||||
artifactName: name,
|
|
||||||
artifactItems: [],
|
|
||||||
size: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
return uploadResponse
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
|
||||||
|
import {checkArtifactName} from './path-and-artifact-name-validation'
|
||||||
|
import {UploadOptions} from './upload-options'
|
||||||
|
import {UploadResponse} from './upload-response'
|
||||||
|
|
||||||
|
export async function uploadArtifact(
|
||||||
|
name: string,
|
||||||
|
files: string[],
|
||||||
|
rootDirectory: string,
|
||||||
|
options?: UploadOptions | undefined
|
||||||
|
): Promise<UploadResponse> {
|
||||||
|
|
||||||
|
// Need to keep checking the artifact name
|
||||||
|
checkArtifactName(name)
|
||||||
|
|
||||||
|
// TODO Twirp call to create new artifact
|
||||||
|
|
||||||
|
// TODO Upload to blob storage using SAS URL
|
||||||
|
|
||||||
|
// TODO Twirp call to finalize the new artifact upload
|
||||||
|
|
||||||
|
const uploadResponse: UploadResponse = {
|
||||||
|
artifactName: name,
|
||||||
|
artifactItems: [],
|
||||||
|
size: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return uploadResponse
|
||||||
|
}
|
Loading…
Reference in New Issue