mirror of https://github.com/actions/toolkit
Restructuring
parent
95cf02468e
commit
962fd91d75
|
@ -1,6 +1,6 @@
|
|||
import { ArtifactClient, DefaultArtifactClient} from './internal/artifact-client'
|
||||
import { UploadOptions } from './internal/upload-options'
|
||||
import { UploadResponse } from './internal/upload-response'
|
||||
import { ArtifactClient, DefaultArtifactClient} from './internal/internal-artifact-client'
|
||||
import { UploadOptions } from './internal/upload/upload-options'
|
||||
import { UploadResponse } from './internal/upload/upload-response'
|
||||
|
||||
/**
|
||||
* 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-options'
|
||||
import {UploadResponse} from './upload-response'
|
||||
import { UploadOptions } from './upload/upload-options'
|
||||
import { UploadResponse } from './upload/upload-response'
|
||||
import { uploadArtifact } from './upload/upload-artifact'
|
||||
|
||||
export interface ArtifactClient {
|
||||
/**
|
||||
|
@ -39,22 +39,6 @@ export class DefaultArtifactClient implements ArtifactClient {
|
|||
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
|
||||
return uploadArtifact(name, files, rootDirectory, options)
|
||||
}
|
||||
}
|
|
@ -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