@@ -46,6 +46,7 @@ stages:
46
46
is_cross_compile : true
47
47
gcc_prefix :
48
48
gcc_suffix :
49
+ deb_arch :
49
50
windows-x64 :
50
51
poolName : Azure Pipelines
51
52
imageName : ' windows-latest'
@@ -55,6 +56,7 @@ stages:
55
56
is_cross_compile : false
56
57
gcc_prefix :
57
58
gcc_suffix :
59
+ deb_arch :
58
60
windows-arm64 :
59
61
poolName : Azure Pipelines
60
62
imageName : ' windows-latest'
@@ -64,6 +66,7 @@ stages:
64
66
is_cross_compile : true
65
67
gcc_prefix :
66
68
gcc_suffix :
69
+ deb_arch :
67
70
linux-x86 :
68
71
poolName : Azure Pipelines
69
72
imageName : ' ubuntu-latest'
@@ -73,6 +76,7 @@ stages:
73
76
is_cross_compile : true
74
77
gcc_prefix : x86_64-linux-gnu-
75
78
gcc_suffix : -x86_64-linux-gnu
79
+ deb_arch : x86
76
80
linux-x64 :
77
81
poolName : Azure Pipelines
78
82
imageName : ' ubuntu-latest'
@@ -82,6 +86,7 @@ stages:
82
86
is_cross_compile : false
83
87
gcc_prefix :
84
88
gcc_suffix :
89
+ deb_arch : amd64
85
90
linux-arm :
86
91
poolName : Azure Pipelines
87
92
imageName : ' ubuntu-latest'
@@ -91,6 +96,7 @@ stages:
91
96
is_cross_compile : true
92
97
gcc_prefix : arm-linux-gnueabi-
93
98
gcc_suffix : -arm-linux-gnueabi
99
+ deb_arch : arm
94
100
linux-arm64 :
95
101
poolName : Azure Pipelines
96
102
imageName : ' ubuntu-latest'
@@ -100,6 +106,7 @@ stages:
100
106
is_cross_compile : true
101
107
gcc_prefix : aarch64-linux-gnu-
102
108
gcc_suffix : -aarch64-linux-gnu
109
+ deb_arch : arm64
103
110
macos-x64 :
104
111
poolName : Azure Pipelines
105
112
imageName : ' macos-latest'
@@ -109,6 +116,7 @@ stages:
109
116
is_cross_compile : false
110
117
gcc_prefix :
111
118
gcc_suffix :
119
+ deb_arch :
112
120
113
121
pool :
114
122
name : $(poolName)
@@ -314,6 +322,35 @@ stages:
314
322
sourceFolder : ' $(Build.SourcesDirectory)/build/pack'
315
323
targetFolder : ' $(Build.ArtifactStagingDirectory)/pack'
316
324
325
+ - bash : |
326
+ deb_pkg_name=rnp_$(build.version)-1_$(DEB_ARCH)
327
+ echo "Creating deb package: $deb_pkg_name"
328
+
329
+ echo "Copy binaries to $deb_pkg_name/usr/local/bin"
330
+ mkdir -p $deb_pkg_name/usr/local/bin
331
+ cp rnp $deb_pkg_name/usr/local/bin/
332
+ echo ""
333
+
334
+ echo "Generating deb package control file: $deb_pkg_name"
335
+ mkdir -p $deb_pkg_name/DEBIAN
336
+ cat $(Build.SourcesDirectory)/build/templates/debian/control | sed -e 's/{build_version}/$(build.version)/g' -e 's/{deb_arch}/$(DEB_ARCH)/g' > $deb_pkg_name/DEBIAN/control
337
+ echo "Deb package control file generated: $deb_pkg_name/DEBIAN/control"
338
+ cat $deb_pkg_name/DEBIAN/control
339
+ echo ""
340
+
341
+ echo "Building deb package: $deb_pkg_name"
342
+ dpkg-deb --build --root-owner-group $deb_pkg_name
343
+ if [ $? -ne 0 ]; then
344
+ echo "Build deb package failed!"
345
+ exit 1
346
+ fi
347
+
348
+ mkdir -p $(Build.ArtifactStagingDirectory)/debian
349
+ cp $deb_pkg_name.deb $(Build.ArtifactStagingDirectory)/debian/
350
+ displayName: Build debian packages
351
+ condition: and(succeeded(), ne(variables['deb_arch'], ''))
352
+ workingDirectory: $(Build.SourcesDirectory)/target/$(TARGET)/release
353
+
317
354
#
318
355
# Publish all pipeline artifacts
319
356
#
@@ -396,12 +433,15 @@ stages:
396
433
windows-x64 :
397
434
poolName : Azure Pipelines
398
435
imageName : ' windows-latest'
436
+ target_short : windows.x64
399
437
linux-x64 :
400
438
poolName : Azure Pipelines
401
439
imageName : ' ubuntu-latest'
440
+ target_short : linux.x64
402
441
macos-x64 :
403
442
poolName : Azure Pipelines
404
443
imageName : ' macos-latest'
444
+ target_short : macos.x64
405
445
406
446
pool :
407
447
name : $(poolName)
@@ -446,7 +486,39 @@ stages:
446
486
cargo install --path .
447
487
displayName: 'Install Rnp from source package'
448
488
workingDirectory: $(System.DefaultWorkingDirectory)/Source
449
-
489
+
490
+ - bash : |
491
+ echo "Checking rnp exists before installation"
492
+ dpkg -l | grep rnp
493
+ echo ""
494
+
495
+ echo "Install rnp from debian package"
496
+ sudo dpkg -i ./rnp_$(build.version)-1_amd64.deb
497
+ if [ $? -ne 0 ]; then
498
+ echo "Failed to install rnp from debian package"
499
+ exit 1
500
+ fi
501
+ echo ""
502
+
503
+ echo "Check if rnp is successfully installed"
504
+ dpkg -l | grep rnp
505
+ echo ""
506
+
507
+ echo "Uninstall rnp"
508
+ sudo dpkg -r rnp
509
+ if [ $? -ne 0 ]; then
510
+ echo "Failed to uninstall rnp"
511
+ exit 1
512
+ fi
513
+ echo ""
514
+
515
+ echo "Check if rnp is successfully uninstalled"
516
+ dpkg -l | grep rnp
517
+ echo ""
518
+ displayName: 'Install Rnp from debian package'
519
+ condition: and(succeeded(), eq(variables['target_short'], 'linux.x64'))
520
+ workingDirectory: $(System.DefaultWorkingDirectory)/r12f.rnp/Pack.Pack/Releases/DebianPackages
521
+
450
522
- task : PublishPipelineArtifact@1
451
523
displayName : Publish pipeline artifact
452
524
inputs :
0 commit comments