@@ -56,7 +56,11 @@ test.serial("Publish a release with templated path", async (t) => {
56
56
const encodedGitTag = encodeURIComponent ( nextRelease . gitTag ) ;
57
57
const generic = { path : "${env.FIXTURE}.txt" , filepath : "/upload.txt" } ;
58
58
const assets = [ generic ] ;
59
- const uploaded = { url : "/uploads/upload.txt" , alt : "upload.txt" } ;
59
+ const uploaded = {
60
+ url : "/uploads/upload.txt" ,
61
+ alt : "upload.txt" ,
62
+ full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/upload.txt" ,
63
+ } ;
60
64
const gitlab = authenticate ( env )
61
65
. post ( `/projects/${ encodedRepoId } /releases` , {
62
66
tag_name : nextRelease . gitTag ,
@@ -65,7 +69,7 @@ test.serial("Publish a release with templated path", async (t) => {
65
69
links : [
66
70
{
67
71
name : "upload.txt" ,
68
- url : `https://gitlab.com/ ${ owner } / ${ repo } ${ uploaded . url } ` ,
72
+ url : `https://gitlab.com${ uploaded . full_path } ` ,
69
73
filepath : "/upload.txt" ,
70
74
} ,
71
75
] ,
@@ -79,7 +83,7 @@ test.serial("Publish a release with templated path", async (t) => {
79
83
const result = await publish ( { assets } , { env, cwd, options, nextRelease, logger : t . context . logger } ) ;
80
84
81
85
t . is ( result . url , `https://gitlab.com/${ owner } /${ repo } /-/releases/${ encodedGitTag } ` ) ;
82
- t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , uploaded . url ] ) ;
86
+ t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , `https://gitlab.com ${ uploaded . full_path } ` ] ) ;
83
87
t . deepEqual ( t . context . log . args [ 1 ] , [ "Published GitLab release: %s" , nextRelease . gitTag ] ) ;
84
88
t . true ( gitlab . isDone ( ) ) ;
85
89
} ) ;
@@ -93,7 +97,11 @@ test.serial("Publish a release with assets", async (t) => {
93
97
const options = { repositoryUrl : `https://gitlab.com/${ owner } /${ repo } .git` } ;
94
98
const encodedRepoId = encodeURIComponent ( `${ owner } /${ repo } ` ) ;
95
99
const encodedGitTag = encodeURIComponent ( nextRelease . gitTag ) ;
96
- const uploaded = { url : "/uploads/file.css" , alt : "file.css" } ;
100
+ const uploaded = {
101
+ url : "/uploads/file.css" ,
102
+ alt : "file.css" ,
103
+ full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/file.css" ,
104
+ } ;
97
105
const assets = [ [ "**" , "!**/*.txt" , "!.dotfile" ] ] ;
98
106
const gitlab = authenticate ( env )
99
107
. post ( `/projects/${ encodedRepoId } /releases` , {
@@ -103,7 +111,7 @@ test.serial("Publish a release with assets", async (t) => {
103
111
links : [
104
112
{
105
113
name : uploaded . alt ,
106
- url : `https://gitlab.com/ ${ owner } / ${ repo } ${ uploaded . url } ` ,
114
+ url : `https://gitlab.com${ uploaded . full_path } ` ,
107
115
} ,
108
116
] ,
109
117
} ,
@@ -116,7 +124,7 @@ test.serial("Publish a release with assets", async (t) => {
116
124
const result = await publish ( { assets } , { env, cwd, options, nextRelease, logger : t . context . logger } ) ;
117
125
118
126
t . is ( result . url , `https://gitlab.com/${ owner } /${ repo } /-/releases/${ encodedGitTag } ` ) ;
119
- t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , uploaded . url ] ) ;
127
+ t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , `https://gitlab.com ${ uploaded . full_path } ` ] ) ;
120
128
t . deepEqual ( t . context . log . args [ 1 ] , [ "Published GitLab release: %s" , nextRelease . gitTag ] ) ;
121
129
t . true ( gitlabUpload . isDone ( ) ) ;
122
130
t . true ( gitlab . isDone ( ) ) ;
@@ -315,7 +323,13 @@ test.serial("Publish a release with asset type and permalink", async (t) => {
315
323
const options = { repositoryUrl : `https://gitlab.com/${ owner } /${ repo } .git` } ;
316
324
const encodedRepoId = encodeURIComponent ( `${ owner } /${ repo } ` ) ;
317
325
const encodedGitTag = encodeURIComponent ( nextRelease . gitTag ) ;
318
- const uploaded = { url : "/uploads/file.css" , alt : "file.css" , link_type : "package" , filepath : "/dist/file.css" } ;
326
+ const uploaded = {
327
+ url : "/uploads/file.css" ,
328
+ alt : "file.css" ,
329
+ link_type : "package" ,
330
+ filepath : "/dist/file.css" ,
331
+ full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/file.css" ,
332
+ } ;
319
333
const assets = [
320
334
{
321
335
path : [ "**" , "!**/*.txt" , "!.dotfile" ] ,
@@ -331,7 +345,7 @@ test.serial("Publish a release with asset type and permalink", async (t) => {
331
345
links : [
332
346
{
333
347
name : uploaded . alt ,
334
- url : `https://gitlab.com/ ${ owner } / ${ repo } ${ uploaded . url } ` ,
348
+ url : `https://gitlab.com${ uploaded . full_path } ` ,
335
349
link_type : uploaded . link_type ,
336
350
filepath : uploaded . filepath ,
337
351
} ,
@@ -346,7 +360,7 @@ test.serial("Publish a release with asset type and permalink", async (t) => {
346
360
const result = await publish ( { assets } , { env, cwd, options, nextRelease, logger : t . context . logger } ) ;
347
361
348
362
t . is ( result . url , `https://gitlab.com/${ owner } /${ repo } /-/releases/${ encodedGitTag } ` ) ;
349
- t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , uploaded . url ] ) ;
363
+ t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , `https://gitlab.com ${ uploaded . full_path } ` ] ) ;
350
364
t . deepEqual ( t . context . log . args [ 1 ] , [ "Published GitLab release: %s" , nextRelease . gitTag ] ) ;
351
365
t . true ( gitlabUpload . isDone ( ) ) ;
352
366
t . true ( gitlab . isDone ( ) ) ;
@@ -361,7 +375,11 @@ test.serial("Publish a release with an asset with a template label", async (t) =
361
375
const options = { repositoryUrl : `https://gitlab.com/${ owner } /${ repo } .git` } ;
362
376
const encodedRepoId = encodeURIComponent ( `${ owner } /${ repo } ` ) ;
363
377
const encodedGitTag = encodeURIComponent ( nextRelease . gitTag ) ;
364
- const uploaded = { url : "/uploads/file.css" , alt : "file.css" } ;
378
+ const uploaded = {
379
+ url : "/uploads/file.css" ,
380
+ alt : "file.css" ,
381
+ full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/file.css" ,
382
+ } ;
365
383
const assets = [
366
384
{
367
385
label : `file-v\${nextRelease.version}.css` ,
@@ -378,7 +396,7 @@ test.serial("Publish a release with an asset with a template label", async (t) =
378
396
links : [
379
397
{
380
398
name : "file-v1.0.0.css" ,
381
- url : `https://gitlab.com/ ${ owner } / ${ repo } ${ uploaded . url } ` ,
399
+ url : `https://gitlab.com${ uploaded . full_path } ` ,
382
400
link_type : "other" ,
383
401
filepath : "/dist/file.css" ,
384
402
} ,
@@ -393,7 +411,7 @@ test.serial("Publish a release with an asset with a template label", async (t) =
393
411
const result = await publish ( { assets } , { env, cwd, options, nextRelease, logger : t . context . logger } ) ;
394
412
395
413
t . is ( result . url , `https://gitlab.com/${ owner } /${ repo } /-/releases/${ encodedGitTag } ` ) ;
396
- t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , uploaded . url ] ) ;
414
+ t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , `https://gitlab.com ${ uploaded . full_path } ` ] ) ;
397
415
t . deepEqual ( t . context . log . args [ 1 ] , [ "Published GitLab release: %s" , nextRelease . gitTag ] ) ;
398
416
t . true ( gitlabUpload . isDone ( ) ) ;
399
417
t . true ( gitlab . isDone ( ) ) ;
@@ -410,7 +428,11 @@ test.serial("Publish a release (with an link) with variables", async (t) => {
410
428
const options = { repositoryUrl : `https://gitlab.com/${ owner } /${ repo } .git` } ;
411
429
const encodedRepoId = encodeURIComponent ( `${ owner } /${ repo } ` ) ;
412
430
const encodedGitTag = encodeURIComponent ( nextRelease . gitTag ) ;
413
- const uploaded = { url : "/uploads/file.css" , alt : "file.css" } ;
431
+ const uploaded = {
432
+ url : "/uploads/file.css" ,
433
+ alt : "file.css" ,
434
+ full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/file.css" ,
435
+ } ;
414
436
const assets = [
415
437
{
416
438
label : `README-v\${nextRelease.version}.md` ,
@@ -437,7 +459,7 @@ test.serial("Publish a release (with an link) with variables", async (t) => {
437
459
} ,
438
460
{
439
461
name : "file.css" ,
440
- url : `https://gitlab.com/ ${ owner } / ${ repo } ${ uploaded . url } ` ,
462
+ url : `https://gitlab.com${ uploaded . full_path } ` ,
441
463
link_type : "other" ,
442
464
filepath : "/dist/file.css" ,
443
465
} ,
@@ -452,7 +474,7 @@ test.serial("Publish a release (with an link) with variables", async (t) => {
452
474
const result = await publish ( { assets } , { env, cwd, options, nextRelease, logger : t . context . logger } ) ;
453
475
454
476
t . is ( result . url , `https://gitlab.com/${ owner } /${ repo } /-/releases/${ encodedGitTag } ` ) ;
455
- t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , uploaded . url ] ) ;
477
+ t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , `https://gitlab.com ${ uploaded . full_path } ` ] ) ;
456
478
t . deepEqual ( t . context . log . args [ 1 ] , [ "Published GitLab release: %s" , nextRelease . gitTag ] ) ;
457
479
t . true ( gitlabUpload . isDone ( ) ) ;
458
480
t . true ( gitlab . isDone ( ) ) ;
@@ -524,7 +546,10 @@ test.serial("Publish a release with one asset and custom label", async (t) => {
524
546
const options = { repositoryUrl : `https://gitlab.com/${ owner } /${ repo } .git` } ;
525
547
const encodedRepoId = encodeURIComponent ( `${ owner } /${ repo } ` ) ;
526
548
const encodedGitTag = encodeURIComponent ( nextRelease . gitTag ) ;
527
- const uploaded = { url : "/uploads/upload.txt" } ;
549
+ const uploaded = {
550
+ url : "/uploads/upload.txt" ,
551
+ full_path : "/-/project/4/66dbcd21ec5d24ed6ea225176098d52b/upload.txt" ,
552
+ } ;
528
553
const assetLabel = "Custom Label" ;
529
554
const assets = [ { path : "upload.txt" , label : assetLabel } ] ;
530
555
const gitlab = authenticate ( env )
@@ -535,7 +560,7 @@ test.serial("Publish a release with one asset and custom label", async (t) => {
535
560
links : [
536
561
{
537
562
name : assetLabel ,
538
- url : `https://gitlab.com/ ${ owner } / ${ repo } ${ uploaded . url } ` ,
563
+ url : `https://gitlab.com${ uploaded . full_path } ` ,
539
564
} ,
540
565
] ,
541
566
} ,
@@ -548,7 +573,7 @@ test.serial("Publish a release with one asset and custom label", async (t) => {
548
573
const result = await publish ( { assets } , { env, cwd, options, nextRelease, logger : t . context . logger } ) ;
549
574
550
575
t . is ( result . url , `https://gitlab.com/${ owner } /${ repo } /-/releases/${ encodedGitTag } ` ) ;
551
- t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , uploaded . url ] ) ;
576
+ t . deepEqual ( t . context . log . args [ 0 ] , [ "Uploaded file: %s" , `https://gitlab.com ${ uploaded . full_path } ` ] ) ;
552
577
t . deepEqual ( t . context . log . args [ 1 ] , [ "Published GitLab release: %s" , nextRelease . gitTag ] ) ;
553
578
t . true ( gitlabUpload . isDone ( ) ) ;
554
579
t . true ( gitlab . isDone ( ) ) ;
0 commit comments