Skip to content

Commit b8fed69

Browse files
authored
Add LICENSE/NOTICE.md to sqlcmd install folder (#289)
1 parent 9753917 commit b8fed69

12 files changed

+77
-41
lines changed

.pipelines/include-install-go-tools.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ steps:
88
command: 'get'
99
arguments: '-d'
1010
workingDirectory: '$(Build.SourcesDirectory)/cmd/sqlcmd'
11-
12-
11+
1312
- task: Go@0
1413
displayName: 'Go: install gotest.tools/gotestsum'
1514
inputs:

build/azure-pipelines/build-common.yml

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ parameters:
44
default:
55
- name: Arch
66
type: string
7-
default:
87
- name: ArtifactName
98
type: string
109
- name: VersionTag

build/azure-pipelines/build-product.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -20,56 +20,56 @@ stages:
2020
matrix:
2121
linux:
2222
imageName: 'ubuntu-latest'
23-
artifact: LinuxAmd64
23+
artifact: Linux-amd64
2424
os:
2525
arch:
2626
binaryName: 'sqlcmd'
2727
binaryExt: ''
2828
mac:
2929
imageName: 'macOS-latest'
30-
artifact: DarwinAmd64
30+
artifact: Darwin-x64
3131
os:
3232
arch:
3333
binaryName: 'sqlcmd'
3434
binaryExt: ''
3535
macArm:
3636
imageName: 'macOS-latest'
37-
artifact: DarwinArm64
37+
artifact: Darwin-arm64
3838
os:
3939
arch: arm64
4040
binaryName: 'sqlcmd'
4141
binaryExt: ''
4242
windows:
4343
imageName: 'windows-latest'
44-
artifact: WindowsAmd64
44+
artifact: Windows-x64
4545
os:
4646
arch:
4747
binaryName: 'sqlcmd'
4848
binaryExt: '.exe'
4949
linuxArm:
5050
imageName: 'ubuntu-latest'
51-
artifact: LinuxArm64
51+
artifact: Linux-arm64
5252
os:
5353
arch: arm64
5454
binaryName: 'sqlcmd'
5555
binaryExt: ''
5656
windowsArm:
5757
imageName: 'windows-latest'
58-
artifact: WindowsArm
58+
artifact: Windows-arm
5959
os:
6060
arch: arm
6161
binaryName: 'sqlcmd'
6262
binaryExt: '.exe'
6363
windowsArm64:
6464
imageName: 'windows-latest'
65-
artifact: WindowsArm64
65+
artifact: Windows-arm64
6666
os:
6767
arch: arm64
6868
binaryName: 'sqlcmd'
6969
binaryExt: '.exe'
7070
linuxs390x:
7171
imageName: 'ubuntu-latest'
72-
artifact: LinuxS390x
72+
artifact: Linux-s390x
7373
os:
7474
arch: s390x
7575
binaryName: 'sqlcmd'
@@ -154,51 +154,51 @@ stages:
154154
MaxConcurrency: '50'
155155
MaxRetryAttempts: '5'
156156
- task: ArchiveFiles@2
157-
displayName: Zip Windows amd64 binary
157+
displayName: Zip Windows x64 binary
158158
inputs:
159-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindowsAmd64'
159+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindows-x64'
160160
includeRootFolder: false
161161
archiveType: 'zip'
162162
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-windows-x64.zip'
163163

164164
- task: ArchiveFiles@2
165165
displayName: Zip Windows arm binary
166166
inputs:
167-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindowsArm'
167+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindows-arm'
168168
includeRootFolder: false
169169
archiveType: 'zip'
170170
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-windows-arm.zip'
171171

172172
- task: ArchiveFiles@2
173173
displayName: Zip Windows arm64 binary
174174
inputs:
175-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindowsArm64'
175+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindows-arm64'
176176
includeRootFolder: false
177177
archiveType: 'zip'
178178
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-windows-arm64.zip'
179179

180180
- task: ArchiveFiles@2
181181
displayName: Tar Linux amd64 binary
182182
inputs:
183-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinuxAmd64'
183+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinux-amd64'
184184
includeRootFolder: false
185185
archiveType: 'tar'
186186
tarCompression: 'bz2'
187-
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-linux-x64.tar.bz2'
187+
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-linux-amd64.tar.bz2'
188188

189189
- task: ArchiveFiles@2
190190
displayName: Tar Darwin binary
191191
inputs:
192-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdDarwinAmd64'
192+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdDarwin-x64'
193193
includeRootFolder: false
194194
archiveType: 'tar'
195195
tarCompression: 'bz2'
196196
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-darwin-x64.tar.bz2'
197197

198198
- task: ArchiveFiles@2
199-
displayName: Tar Darwin Arm binary
199+
displayName: Tar Darwin arm binary
200200
inputs:
201-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdDarwinArm64'
201+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdDarwin-arm64'
202202
includeRootFolder: false
203203
archiveType: 'tar'
204204
tarCompression: 'bz2'
@@ -207,7 +207,7 @@ stages:
207207
- task: ArchiveFiles@2
208208
displayName: Tar Linux arm64 binary
209209
inputs:
210-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinuxArm64'
210+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinux-arm64'
211211
includeRootFolder: false
212212
archiveType: 'tar'
213213
tarCompression: 'bz2'
@@ -216,7 +216,7 @@ stages:
216216
- task: ArchiveFiles@2
217217
displayName: Tar Linux s390x binary
218218
inputs:
219-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinuxS390x'
219+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinux-s390x'
220220
includeRootFolder: false
221221
archiveType: 'tar'
222222
tarCompression: 'bz2'

build/azure-pipelines/package-common-create.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ parameters:
22
- name: OS
33
type: string
44
default:
5+
- name: Architecture
6+
type: string
57
- name: Type
68
type: string
79

@@ -41,6 +43,7 @@ steps:
4143
msbuildArgs: '/p:Configuration=Release'
4244
env:
4345
CLI_VERSION: $(VERSION_TAG)
46+
ARCHITECTURE: ${{ parameters.Architecture }}
4447
- task: EsrpCodeSigning@2
4548
condition: eq(variables.OS, 'windows')
4649
inputs:
@@ -100,7 +103,7 @@ steps:
100103
inputs:
101104
targetType: 'inline'
102105
script: |
103-
mv "$(Build.SourcesDirectory)/release/windows/msi/bin/Release/sqlcmd.msi" "$(Build.SourcesDirectory)/release/windows/msi/bin/Release/sqlcmd_${CLI_VERSION}-${CLI_VERSION_REVISION}.msi"
106+
mv "$(Build.SourcesDirectory)/release/windows/msi/bin/Release/sqlcmd.msi" "$(Build.SourcesDirectory)/release/windows/msi/bin/Release/sqlcmd-${{ parameters.ARCHITECTURE }}_${CLI_VERSION}-${CLI_VERSION_REVISION}.msi"
104107
env:
105108
CLI_VERSION: $(VERSION_TAG)
106109
CLI_VERSION_REVISION: 1
@@ -132,7 +135,7 @@ steps:
132135
MaxConcurrency: '50'
133136
MaxRetryAttempts: '20'
134137
- task: PublishPipelineArtifact@0
135-
displayName: 'Publish Artifact: ${{ parameters.Type }}'
138+
displayName: 'Publish Artifact: ${{ parameters.Type }} ${{ parameters.Architecture }}'
136139
inputs:
137140
targetPath: $(Build.ArtifactStagingDirectory)
138-
artifactName: ${{ parameters.Type }}
141+
artifactName: ${{ parameters.Type }} ${{ parameters.Architecture }}

build/azure-pipelines/package-common-test.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ parameters:
22
- name: OS
33
type: string
44
default:
5+
- name: Architecture
6+
type: string
57
- name: Type
68
type: string
79

@@ -25,12 +27,17 @@ steps:
2527
CLI_VERSION: $(VERSION_TAG)
2628
BUILD_STAGINGDIRECTORY: $(Build.ArtifactStagingDirectory)
2729
- task: PowerShell@2
28-
condition: eq(variables.OS, 'windows')
29-
displayName: 'Test ${{ parameters.OS }}/${{ parameters.Type }} package'
30+
31+
# Windows ARM not available in ADO pipelines yet, so only test on Amd64
32+
# https://learn.microsoft.com/azure/devops/pipelines/agents/hosted
33+
# https://github.com/microsoft/azure-pipelines-agent/issues/3935
34+
condition: and(eq(variables.OS, 'windows'), eq(variables.Architecture, 'x64'))
35+
displayName: 'Test ${{ parameters.OS }}/${{ parameters.Architecture }}/${{ parameters.Type }} package'
3036
inputs:
3137
targetType: 'filePath'
3238
filePath: '$(Build.SourcesDirectory)\release\windows\msi\scripts\pipeline-test.ps1'
3339
failOnStderr: true
3440
env:
3541
CLI_VERSION: $(VERSION_TAG)
42+
ARCHITECTURE: ${{ parameters.Architecture }}
3643

build/azure-pipelines/package-product.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,42 @@ stages:
1919
imageName: 'ubuntu-latest'
2020
os: linux
2121
type: rpm
22+
architecture: x86_x64
2223
debian:
2324
imageName: 'ubuntu-latest'
2425
os: linux
2526
type: deb
27+
architecture: amd64
2628
docker:
2729
imageName: 'ubuntu-latest'
2830
os: linux
2931
type: docker
30-
windows:
32+
architecture: amd64
33+
windows-x64:
3134
imageName: 'windows-2019'
3235
os: windows
36+
architecture: x64
37+
type: msi
38+
windows-arm:
39+
imageName: 'windows-2019'
40+
os: windows
41+
architecture: arm
42+
type: msi
43+
windows-arm64:
44+
imageName: 'windows-2019'
45+
os: windows
46+
architecture: arm64
3347
type: msi
3448
pool:
3549
vmImage: $(imageName)
3650
steps:
3751
- template: package-common-create.yml
3852
parameters:
3953
OS: $(os)
54+
Architecture: $(architecture)
4055
Type: $(type)
4156
- template: package-common-test.yml
4257
parameters:
4358
OS: $(os)
59+
Architecture: $(architecture)
4460
Type: $(type)

release/linux/deb/pipeline.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ DIST_DIR=${BUILD_STAGINGDIRECTORY:=${REPO_ROOT_DIR}/output/debian}
4646
PIPELINE_WORKSPACE=${REPO_ROOT_DIR}
4747

4848
if [[ "${BUILD_OUTPUT}" != "" ]]; then
49-
cp ${BUILD_OUTPUT}/SqlcmdLinuxAmd64/sqlcmd ${REPO_ROOT_DIR}/sqlcmd
49+
cp ${BUILD_OUTPUT}/SqlcmdLinux-amd64/sqlcmd ${REPO_ROOT_DIR}/sqlcmd
5050
fi
5151

5252
CLI_VERSION=${CLI_VERSION:=0.0.1}

release/linux/docker/pipeline.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ DIST_DIR=${BUILD_STAGINGDIRECTORY:=${REPO_ROOT_DIR}/output/docker}
2222
IMAGE_NAME=microsoft/sqlcmd${BUILD_BUILDNUMBER:=''}
2323

2424
if [[ "${BUILD_OUTPUT}" != "" ]]; then
25-
cp ${BUILD_OUTPUT}/SqlcmdLinuxAmd64/sqlcmd ${REPO_ROOT_DIR}/sqlcmd
25+
cp ${BUILD_OUTPUT}/SqlcmdLinux-amd64/sqlcmd ${REPO_ROOT_DIR}/sqlcmd
2626
fi
2727

2828
chmod u+x ${REPO_ROOT_DIR}/sqlcmd

release/linux/rpm/pipeline.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -exv
2222
: "${REPO_ROOT_DIR:=`cd $(dirname $0); cd ../../../; pwd`}"
2323

2424
if [[ "${BUILD_OUTPUT}" != "" ]]; then
25-
cp ${BUILD_OUTPUT}/SqlcmdLinuxAmd64/sqlcmd ${REPO_ROOT_DIR}/sqlcmd
25+
cp ${BUILD_OUTPUT}/SqlcmdLinux-amd64/sqlcmd ${REPO_ROOT_DIR}/sqlcmd
2626
fi
2727

2828
DIST_DIR=${BUILD_STAGINGDIRECTORY:=${REPO_ROOT_DIR}/output/rpm}

release/windows/msi/product.wxs

+18-7
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,11 @@
4444
<Directory Id="SqlcmdDirectory" Name="$(var.AppName)">
4545
<Component Id="sqlcmd.exe" Guid="2988854C-D02C-4D48-866C-8EAEBA6BC54B">
4646
<CreateFolder />
47-
<RemoveFolder Id="RemoveSqlCmdDirectory" On="uninstall" />
48-
<RegistryKey Root="HKCU" Key="Software\Microsoft\SqlCmd">
49-
<RegistryValue Name="MainExe" Value="1" KeyPath="yes" Type="integer" />
50-
</RegistryKey>
47+
<RemoveFolder Id="RemoveFolder" On="uninstall" />
5148
<File
5249
Id="sqlcmd.exe"
5350
Name="sqlcmd.exe"
54-
Source="$(env.PIPELINE_WORKSPACE)\SqlcmdWindowsAmd64\sqlcmd.exe"
55-
DiskId="1"
51+
Source="$(env.PIPELINE_WORKSPACE)\SqlcmdWindows-$(env.ARCHITECTURE)\sqlcmd.exe"
5652
Checksum="yes"/>
5753
<Environment
5854
Id="PATH"
@@ -63,6 +59,20 @@
6359
Action="set"
6460
System="yes" />
6561
</Component>
62+
<Component Id="notice" Guid="9BB06B71-91BF-4431-B88D-C7E4BCA1F435">
63+
<File
64+
Id="NOTICE.md"
65+
Name="NOTICE.md"
66+
Source="$(env.PIPELINE_WORKSPACE)\SqlcmdWindows-$(env.ARCHITECTURE)\NOTICE.md"
67+
Checksum="no"/>
68+
</Component>
69+
<Component Id="license" Guid="F9E6D3F8-8B09-49C6-8309-74F88DD765B0">
70+
<File
71+
Id="LICENSE"
72+
Name="LICENSE"
73+
Source="$(env.PIPELINE_WORKSPACE)\s\LICENSE"
74+
Checksum="no"/>
75+
</Component>
6676
</Directory>
6777
</Directory>
6878
</Directory>
@@ -71,7 +81,8 @@
7181
Level="1"
7282
AllowAdvertise="no">
7383
<ComponentRef Id="sqlcmd.exe" />
84+
<ComponentRef Id="notice" />
85+
<ComponentRef Id="license" />
7486
</Feature>
75-
7687
</Product>
7788
</Wix>

release/windows/msi/scripts/pipeline-test.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616

1717
if (-not (Test-Path env:CLI_VERSION)) { $env:CLI_VERSION = '0.0.1' }
1818
if (-not (Test-Path env:CLI_VERSION_REVISION)) { $env:CLI_VERSION_REVISION = '1' }
19+
if (-not (Test-Path env:ARCHITECTURE)) { $env:ARCHITECTURE = 'amd64' }
1920

2021
tree /A /F $env:SYSTEM_ARTIFACTSDIRECTORY
2122

22-
$msiPath = Join-Path $env:SYSTEM_ARTIFACTSDIRECTORY ("sqlcmd_" + $env:CLI_VERSION + "-" + $env:CLI_VERSION_REVISION + ".msi")
23+
$msiPath = Join-Path $env:SYSTEM_ARTIFACTSDIRECTORY ("sqlcmd-" + $env:ARCHITECTURE + "_" + $env:CLI_VERSION + "-" + $env:CLI_VERSION_REVISION + ".msi")
2324

2425
$msiPath
2526

release/windows/msi/scripts/pipeline.cmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ set REPO_ROOT=%~dp0..\..\..\..
2929

3030
set PIPELINE_WORKSPACE=%ARTIFACTS_DIR%\workspace
3131

32-
mkdir %PIPELINE_WORKSPACE%\SqlcmdWindowsAmd64
32+
mkdir %PIPELINE_WORKSPACE%\SqlcmdWindows-%ARCHITECTURE%
3333

34-
copy /y %REPO_ROOT%\sqlcmd.exe %PIPELINE_WORKSPACE%\SqlcmdWindowsAmd64\sqlcmd.exe
34+
copy /y %REPO_ROOT%\sqlcmd.exe %PIPELINE_WORKSPACE%\SqlcmdWindows-%ARCHITECTURE%\sqlcmd.exe
3535

3636
::ensure wix is available
3737
if exist %WIX_DIR% (

0 commit comments

Comments
 (0)