diff --git a/pipeline/release/release.go b/pipeline/release/release.go index 1e4ccfaaa..23a1fe92a 100644 --- a/pipeline/release/release.go +++ b/pipeline/release/release.go @@ -58,6 +58,7 @@ func upload(ctx *context.Context, client client.Client, releaseID int, artifact return err } defer func() { _ = file.Close() }() - log.WithField("file", file.Name()).Info("uploading") - return client.Upload(ctx, releaseID, artifact, file) + _, name := filepath.Split(path) + log.WithField("file", file.Name()).WithField("name", name).Info("uploading to release") + return client.Upload(ctx, releaseID, name, file) } diff --git a/pipeline/release/release_test.go b/pipeline/release/release_test.go index 5810ee63b..067cbf552 100644 --- a/pipeline/release/release_test.go +++ b/pipeline/release/release_test.go @@ -46,6 +46,8 @@ func TestRunPipe(t *testing.T) { assert.NoError(doRun(ctx, client)) assert.True(client.CreatedRelease) assert.True(client.UploadedFile) + assert.Contains("bin.deb", client.UploadedFileNames) + assert.Contains("bin.tar.gz", client.UploadedFileNames) } func TestRunPipeReleaseCreationFailed(t *testing.T) { @@ -141,6 +143,7 @@ type DummyClient struct { FailToUpload bool CreatedRelease bool UploadedFile bool + UploadedFileNames []string } func (client *DummyClient) CreateRelease(ctx *context.Context, body string) (releaseID int, err error) { @@ -160,5 +163,6 @@ func (client *DummyClient) Upload(ctx *context.Context, releaseID int, name stri return errors.New("upload failed") } client.UploadedFile = true + client.UploadedFileNames = append(client.UploadedFileNames, name) return }