Skip to content

Commit 32462b7

Browse files
authored
Add an ARM64 Linux and ARM Windows binary to the release (#35)
* add arm builds * fix parameter references * fix code sign * try to fix codesign again
1 parent 07e30ce commit 32462b7

File tree

2 files changed

+65
-9
lines changed

2 files changed

+65
-9
lines changed

build/azure-pipelines/build-common.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
parameters:
2+
- name: OS
3+
type: string
4+
default:
5+
- name: Arch
6+
type: string
7+
default:
8+
- name: ArtifactName
9+
type: string
10+
111
steps:
212
- task: GoTool@0
313
inputs:
@@ -9,13 +19,19 @@ steps:
919
command: 'get'
1020
arguments: '-d'
1121
workingDirectory: '$(Build.SourcesDirectory)/cmd/sqlcmd'
12-
22+
env:
23+
GOOS: ${{ parameters.OS }}
24+
GOARCH: ${{ parameters.Arch }}
25+
1326
- task: Go@0
1427
displayName: 'Go: build sqlcmd'
1528
inputs:
1629
command: 'build'
1730
arguments: '-o $(Build.BinariesDirectory)'
1831
workingDirectory: '$(Build.SourcesDirectory)/cmd/sqlcmd'
32+
env:
33+
GOOS: ${{ parameters.OS }}
34+
GOARCH: ${{ parameters.Arch }}
1935

2036
- task: CopyFiles@2
2137
inputs:
@@ -27,5 +43,5 @@ steps:
2743
displayName: 'Publish binary'
2844
inputs:
2945
targetPath: $(Build.ArtifactStagingDirectory)
30-
artifactName: Sqlcmd$(Agent.OS)
46+
artifactName: 'Sqlcmd${{ parameters.ArtifactName }}'
3147

build/azure-pipelines/build-product.yml

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,37 @@ stages:
1414
matrix:
1515
linux:
1616
imageName: 'ubuntu-latest'
17+
artifact: LinuxAmd64
18+
os:
19+
arch:
1720
mac:
1821
imageName: 'macOS-latest'
22+
artifact: DarwinAmd64
23+
os:
24+
arch:
1925
windows:
2026
imageName: 'windows-latest'
27+
artifact: WindowsAmd64
28+
os:
29+
arch:
30+
linuxArm:
31+
imageName: 'ubuntu-latest'
32+
artifact: LinuxArm64
33+
os:
34+
arch: arm64
35+
windowsArm:
36+
imageName: 'windows-latest'
37+
artifact: WindowsArm
38+
os:
39+
arch: arm
2140
pool:
2241
vmImage: $(imageName)
2342
steps:
2443
- template: build-common.yml
44+
parameters:
45+
OS: $(os)
46+
Arch: $(arch)
47+
ArtifactName: $(artifact)
2548

2649
- stage: CreatePackages
2750
displayName: Create packages to publish
@@ -48,8 +71,8 @@ stages:
4871
displayName: Sign Windows binary
4972
inputs:
5073
ConnectedServiceName: 'Code Signing'
51-
FolderPath: '$(Pipeline.Workspace)\SqlcmdWindows_NT'
52-
Pattern: '*.exe'
74+
FolderPath: '$(Pipeline.Workspace)'
75+
Pattern: 'sqlcmd.exe'
5376
signConfigType: 'inlineSignParams'
5477
SessionTimeout: '600'
5578
MaxConcurrency: '5'
@@ -98,17 +121,25 @@ stages:
98121
}
99122
]
100123
- task: ArchiveFiles@2
101-
displayName: Zip Windows binary
124+
displayName: Zip Windows amd64 binary
102125
inputs:
103-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindows_NT\Sqlcmd.exe'
126+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindowsAmd64\Sqlcmd.exe'
104127
includeRootFolder: false
105128
archiveType: 'zip'
106129
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(VERSION_TAG)-windows-x64.zip'
107130

108131
- task: ArchiveFiles@2
109-
displayName: Tar Linux binary
132+
displayName: Zip Windows arm binary
133+
inputs:
134+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindowsArm\Sqlcmd.exe'
135+
includeRootFolder: false
136+
archiveType: 'zip'
137+
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(VERSION_TAG)-windows-arm.zip'
138+
139+
- task: ArchiveFiles@2
140+
displayName: Tar Linux amd64 binary
110141
inputs:
111-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinux'
142+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinuxAmd64'
112143
includeRootFolder: false
113144
archiveType: 'tar'
114145
tarCompression: 'bz2'
@@ -117,12 +148,21 @@ stages:
117148
- task: ArchiveFiles@2
118149
displayName: Tar Darwin binary
119150
inputs:
120-
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdDarwin'
151+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdDarwinAmd64'
121152
includeRootFolder: false
122153
archiveType: 'tar'
123154
tarCompression: 'bz2'
124155
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(VERSION_TAG)-darwin-x64.tar.bz2'
125156

157+
- task: ArchiveFiles@2
158+
displayName: Tar Linux arm64 binary
159+
inputs:
160+
rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinuxArm64'
161+
includeRootFolder: false
162+
archiveType: 'tar'
163+
tarCompression: 'bz2'
164+
archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(VERSION_TAG)-linux-arm64.tar.bz2'
165+
126166
- task: PublishPipelineArtifact@1
127167
displayName: 'Publish release archives'
128168
inputs:

0 commit comments

Comments
 (0)