From bf2edf12b6e80dbecc83719f210f5a105e365376 Mon Sep 17 00:00:00 2001 From: davidshi Date: Tue, 4 Jun 2024 09:53:31 -0500 Subject: [PATCH] remove obsolete builds --- build/azure-pipelines/build-common.yml | 91 ------- build/azure-pipelines/build-product.yml | 242 ------------------ build/azure-pipelines/build-tag.yml | 11 - .../azure-pipelines/package-common-create.yml | 141 ---------- build/azure-pipelines/package-common-test.yml | 43 ---- build/azure-pipelines/package-product.yml | 60 ----- 6 files changed, 588 deletions(-) delete mode 100644 build/azure-pipelines/build-common.yml delete mode 100644 build/azure-pipelines/build-product.yml delete mode 100644 build/azure-pipelines/build-tag.yml delete mode 100644 build/azure-pipelines/package-common-create.yml delete mode 100644 build/azure-pipelines/package-common-test.yml delete mode 100644 build/azure-pipelines/package-product.yml diff --git a/build/azure-pipelines/build-common.yml b/build/azure-pipelines/build-common.yml deleted file mode 100644 index b422a62b..00000000 --- a/build/azure-pipelines/build-common.yml +++ /dev/null @@ -1,91 +0,0 @@ -parameters: -- name: OS - type: string - default: -- name: Arch - type: string -- name: ArtifactName - type: string -- name: VersionTag - type: string - default: $(Build.BuildNumber) -- name: BinaryName - type: string -- name: BinaryExt - type: string - -steps: -- task: GoTool@0 - inputs: - version: '1.21' - goBin: $(Build.SourcesDirectory) - -- task: Go@0 - displayName: 'Go install go-winres' - inputs: - command: 'custom' - customCommand: 'install' - arguments: 'github.com/tc-hib/go-winres@latest' - workingDirectory: '$(Build.SourcesDirectory)/cmd/modern' - env: - GOBIN: $(Build.SourcesDirectory) - -- task: CmdLine@2 - displayName: 'generate version resource' - inputs: - script: $(Build.SourcesDirectory)/go-winres make --file-version git-tag --product-version git-tag - workingDirectory: '$(Build.SourcesDirectory)/cmd/modern' - -- task: Go@0 - displayName: 'Go: get dependencies' - inputs: - command: 'get' - arguments: '-d' - workingDirectory: '$(Build.SourcesDirectory)/cmd/modern' - env: - GOOS: ${{ parameters.OS }} - GOARCH: ${{ parameters.Arch }} - GOBIN: $(Build.SourcesDirectory) - -- task: Go@0 - displayName: 'Go: build sqlcmd' - inputs: - command: 'build' - arguments: '-o $(Build.BinariesDirectory)/${{ parameters.BinaryName }}${{ parameters.BinaryExt }} -ldflags="-s -w -X main.version=${{ parameters.VersionTag }}"' - workingDirectory: '$(Build.SourcesDirectory)/cmd/modern' - env: - GOOS: ${{ parameters.OS }} - GOARCH: ${{ parameters.Arch }} - GOBIN: $(Build.SourcesDirectory) - CGO_ENABLED: 0 # Enables Docker image based off 'scratch' - -- task: Go@0 - displayName: 'Go: build sqlcmd with debug symbols' - inputs: - command: 'build' - arguments: '-o $(Build.BinariesDirectory)/${{ parameters.BinaryName }}_debug${{ parameters.BinaryExt }} -ldflags="-X main.version=${{ parameters.VersionTag }}"' - workingDirectory: '$(Build.SourcesDirectory)/cmd/modern' - env: - GOOS: ${{ parameters.OS }} - GOARCH: ${{ parameters.Arch }} - GOBIN: $(Build.SourcesDirectory) - CGO_ENABLED: 0 # Enables Docker image based off 'scratch' - -- task: CopyFiles@2 - inputs: - TargetFolder: '$(Build.ArtifactStagingDirectory)' - SourceFolder: '$(Build.BinariesDirectory)' - Contents: '**' - -- task: CopyFiles@2 - inputs: - TargetFolder: '$(Build.ArtifactStagingDirectory)' - SourceFolder: '$(Build.SourcesDirectory)' - Contents: 'NOTICE.md' - -- task: PublishPipelineArtifact@1 - displayName: 'Publish binary' - inputs: - targetPath: $(Build.ArtifactStagingDirectory) - artifactName: 'Sqlcmd${{ parameters.ArtifactName }}' - diff --git a/build/azure-pipelines/build-product.yml b/build/azure-pipelines/build-product.yml deleted file mode 100644 index befeca24..00000000 --- a/build/azure-pipelines/build-product.yml +++ /dev/null @@ -1,242 +0,0 @@ -trigger: - tags: - include: - - v* - -pr: none - -parameters: - - name: PushToGithub - default: true - type: boolean - displayName: Push packages to github - -stages: - - stage: Compile - displayName: Compile sqlcmd on all supported platforms - jobs: - - job: Sqlcmd - strategy: - matrix: - linux: - imageName: 'ubuntu-latest' - artifact: Linux-amd64 - os: - arch: - binaryName: 'sqlcmd' - binaryExt: '' - mac: - imageName: 'macOS-latest' - artifact: Darwin-x64 - os: - arch: - binaryName: 'sqlcmd' - binaryExt: '' - macArm: - imageName: 'macOS-latest' - artifact: Darwin-arm64 - os: - arch: arm64 - binaryName: 'sqlcmd' - binaryExt: '' - windows: - imageName: 'windows-latest' - artifact: Windows-x64 - os: - arch: - binaryName: 'sqlcmd' - binaryExt: '.exe' - linuxArm: - imageName: 'ubuntu-latest' - artifact: Linux-arm64 - os: - arch: arm64 - binaryName: 'sqlcmd' - binaryExt: '' - windowsArm: - imageName: 'windows-latest' - artifact: Windows-arm - os: - arch: arm - binaryName: 'sqlcmd' - binaryExt: '.exe' - windowsArm64: - imageName: 'windows-latest' - artifact: Windows-arm64 - os: - arch: arm64 - binaryName: 'sqlcmd' - binaryExt: '.exe' - linuxs390x: - imageName: 'ubuntu-latest' - artifact: Linux-s390x - os: - arch: s390x - binaryName: 'sqlcmd' - binaryExt: '' - pool: - vmImage: $(imageName) - steps: - - template: build-tag.yml - - script: | - echo $(getVersion.VERSION_TAG) - - template: build-common.yml - parameters: - OS: $(os) - Arch: $(arch) - ArtifactName: $(artifact) - VersionTag: $(getVersion.VERSION_TAG) - BinaryName: $(binaryName) - BinaryExt: $(binaryExt) - - stage: CreatePackages - displayName: Create packages to publish - jobs: - - job: Sign_and_pack - pool: - vmImage: 'windows-latest' - steps: - - template: build-tag.yml - - task: DownloadPipelineArtifact@2 - inputs: - buildType: 'current' - targetPath: '$(Pipeline.Workspace)' - - task: EsrpCodeSigning@2 - displayName: Sign Windows binary - inputs: - ConnectedServiceName: 'Code Signing' - FolderPath: '$(Pipeline.Workspace)' - Pattern: 'sqlcmd*.exe' - signConfigType: 'inlineSignParams' - inlineOperation: | - [ - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName": "OpusName", - "parameterValue": "go-sqlcmd" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "https://github.com/microsoft/go-sqlcmd" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName": "FileDigest", - "parameterValue": "/fd sha256" - }, - { - "parameterName": "TimeStamp", - "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - }, - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolVerify", - "parameters": [ - { - "parameterName": "VerifyAll", - "parameterValue": "/all" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - } - ] - SessionTimeout: '60' - MaxConcurrency: '50' - MaxRetryAttempts: '5' - - task: ArchiveFiles@2 - displayName: Zip Windows x64 binary - inputs: - rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindows-x64' - includeRootFolder: false - archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-windows-x64.zip' - - - task: ArchiveFiles@2 - displayName: Zip Windows arm binary - inputs: - rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindows-arm' - includeRootFolder: false - archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-windows-arm.zip' - - - task: ArchiveFiles@2 - displayName: Zip Windows arm64 binary - inputs: - rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdWindows-arm64' - includeRootFolder: false - archiveType: 'zip' - archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-windows-arm64.zip' - - - task: ArchiveFiles@2 - displayName: Tar Linux amd64 binary - inputs: - rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinux-amd64' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'bz2' - archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-linux-amd64.tar.bz2' - - - task: ArchiveFiles@2 - displayName: Tar Darwin binary - inputs: - rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdDarwin-x64' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'bz2' - archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-darwin-x64.tar.bz2' - - - task: ArchiveFiles@2 - displayName: Tar Darwin arm binary - inputs: - rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdDarwin-arm64' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'bz2' - archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-darwin-arm64.tar.bz2' - - - task: ArchiveFiles@2 - displayName: Tar Linux arm64 binary - inputs: - rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinux-arm64' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'bz2' - archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-linux-arm64.tar.bz2' - - - task: ArchiveFiles@2 - displayName: Tar Linux s390x binary - inputs: - rootFolderOrFile: '$(Pipeline.Workspace)\SqlcmdLinux-s390x' - includeRootFolder: false - archiveType: 'tar' - tarCompression: 'bz2' - archiveFile: '$(Build.ArtifactStagingDirectory)/sqlcmd-$(getVersion.VERSION_TAG)-linux-s390x.tar.bz2' - - - task: PublishPipelineArtifact@1 - displayName: 'Publish release archives' - inputs: - targetPath: $(Build.ArtifactStagingDirectory) - artifactName: SqlcmdRelease - - - task: GitHubRelease@1 - condition: eq('${{ parameters.PushToGithub}}', 'true') - inputs: - gitHubConnection: 'gosqlcmd_github' - repositoryName: '$(Build.Repository.Name)' - action: 'create' - target: '$(Build.SourceVersion)' - tagSource: 'userSpecifiedTag' - tag: '$(getVersion.VERSION_TAG)' - changeLogCompareToRelease: 'lastFullRelease' - changeLogType: 'commitBased' - isPreRelease: true diff --git a/build/azure-pipelines/build-tag.yml b/build/azure-pipelines/build-tag.yml deleted file mode 100644 index 38796860..00000000 --- a/build/azure-pipelines/build-tag.yml +++ /dev/null @@ -1,11 +0,0 @@ - -steps: -- task: PowerShell@2 - displayName: Set last tag to variable - name: getVersion - inputs: - targetType: 'inline' - script: | - $VERSION_TAG = git describe --tags (git rev-list --tags --max-count=1) - Write-Host("##vso[task.setvariable variable=VERSION_TAG;isoutput=true]$VERSION_TAG") - Write-Host($VERSION_TAG) diff --git a/build/azure-pipelines/package-common-create.yml b/build/azure-pipelines/package-common-create.yml deleted file mode 100644 index 177f15e6..00000000 --- a/build/azure-pipelines/package-common-create.yml +++ /dev/null @@ -1,141 +0,0 @@ -parameters: -- name: OS - type: string - default: -- name: Architecture - type: string -- name: Type - type: string - -steps: -- task: DownloadPipelineArtifact@2 - inputs: - source: 'specific' - project: 'ae14e11c-7eb2-46af-b588-471e6116d635' - pipeline: 500 - runVersion: 'latest' - targetPath: '$(Pipeline.Workspace)' -- task: PowerShell@2 - displayName: Set last tag to variable - inputs: - targetType: 'inline' - script: | - $VERSION_TAG = git describe --tags (git rev-list --tags --max-count=1) - $VERSION_TAG = $VERSION_TAG.substring(1) # Trim initial 'v' - Write-Host("##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG") - Write-Host($VERSION_TAG) -- task: CmdLine@2 - condition: ne(variables.OS, 'windows') - displayName: 'Build ${{ parameters.OS }}/${{ parameters.Type }} distribution' - inputs: - script: release/${{ parameters.OS }}/${{ parameters.Type }}/pipeline.sh - workingDirectory: $(Build.SourcesCliDirectory) - env: - CLI_VERSION: $(VERSION_TAG) - BUILD_OUTPUT: $(Pipeline.Workspace) - BUILD_STAGINGDIRECTORY: $(Build.ArtifactStagingDirectory) -- task: VSBuild@1 - condition: eq(variables.OS, 'windows') - displayName: 'Build Windows MSI distribution' - inputs: - solution: '$(Build.SourcesCliDirectory)\release\windows\msi\sqlcmd.wixproj' - msbuildArchitecture: 'x86' - msbuildArgs: '/p:Configuration=Release' - env: - CLI_VERSION: $(VERSION_TAG) - ARCHITECTURE: ${{ parameters.Architecture }} -- task: EsrpCodeSigning@2 - condition: eq(variables.OS, 'windows') - inputs: - ConnectedServiceName: 'Code Signing' - FolderPath: '$(Build.SourcesDirectory)/release/windows/msi/bin/Release' - Pattern: '*.msi' - signConfigType: 'inlineSignParams' - inlineOperation: | - [ - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName": "OpusName", - "parameterValue": "Sqlcmd Tools" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "https://github.com/microsoft/go-sqlcmd" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName": "FileDigest", - "parameterValue": "/fd sha256" - }, - { - "parameterName": "TimeStamp", - "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - }, - { - "keyCode": "CP-230012", - "operationSetCode": "SigntoolVerify", - "parameters": [ - { - "parameterName": "VerifyAll", - "parameterValue": "/all" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - } - ] - SessionTimeout: '600' - MaxConcurrency: '50' - MaxRetryAttempts: '20' -- task: Bash@3 - condition: eq(variables.OS, 'windows') - displayName: 'Rename MSI' - inputs: - targetType: 'inline' - script: | - 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" - env: - CLI_VERSION: $(VERSION_TAG) - CLI_VERSION_REVISION: 1 -- task: CopyFiles@2 - condition: eq(variables.OS, 'windows') - displayName: 'Copy MSI to: $(Build.ArtifactStagingDirectory)' - inputs: - sourceFolder: $(Build.SourcesDirectory)/release/windows/msi/bin/Release - contents: '?(*.msi|*.md)' - TargetFolder: $(Build.ArtifactStagingDirectory) -- task: EsrpCodeSigning@2 - condition: and(eq(variables.OS, 'linux'), ne(variables.Type, 'docker')) - inputs: - ConnectedServiceName: 'Code Signing' - FolderPath: $(Build.ArtifactStagingDirectory) - Pattern: '*.${{ parameters.Type }}' - signConfigType: 'inlineSignParams' - inlineOperation: | - [ - { - "KeyCode" : "CP-450779-Pgp", - "OperationCode" : "LinuxSign", - "Parameters" : {}, - "ToolName" : "sign", - "ToolVersion" : "1.0" - } - ] - SessionTimeout: '600' - MaxConcurrency: '50' - MaxRetryAttempts: '20' -- task: PublishPipelineArtifact@0 - displayName: 'Publish Artifact: ${{ parameters.Type }} ${{ parameters.Architecture }}' - inputs: - targetPath: $(Build.ArtifactStagingDirectory) - artifactName: ${{ parameters.Type }} ${{ parameters.Architecture }} diff --git a/build/azure-pipelines/package-common-test.yml b/build/azure-pipelines/package-common-test.yml deleted file mode 100644 index e3b5a864..00000000 --- a/build/azure-pipelines/package-common-test.yml +++ /dev/null @@ -1,43 +0,0 @@ -parameters: -- name: OS - type: string - default: -- name: Architecture - type: string -- name: Type - type: string - -steps: -- task: PowerShell@2 - displayName: Set last tag to variable - inputs: - targetType: 'inline' - script: | - $VERSION_TAG = git describe --tags (git rev-list --tags --max-count=1) - $VERSION_TAG = $VERSION_TAG.substring(1) # Trim initial 'v' - Write-Host("##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG") - Write-Host($VERSION_TAG) -- task: CmdLine@2 - condition: ne(variables.OS, 'windows') - displayName: 'Test ${{ parameters.OS }}/${{ parameters.Type }} package' - inputs: - script: release/${{ parameters.OS }}/${{ parameters.Type }}/pipeline-test.sh - workingDirectory: $(Build.SourcesCliDirectory) - env: - CLI_VERSION: $(VERSION_TAG) - BUILD_STAGINGDIRECTORY: $(Build.ArtifactStagingDirectory) -- task: PowerShell@2 - - # Windows ARM not available in ADO pipelines yet, so only test on Amd64 - # https://learn.microsoft.com/azure/devops/pipelines/agents/hosted - # https://github.com/microsoft/azure-pipelines-agent/issues/3935 - condition: and(eq(variables.OS, 'windows'), eq(variables.Architecture, 'x64')) - displayName: 'Test ${{ parameters.OS }}/${{ parameters.Architecture }}/${{ parameters.Type }} package' - inputs: - targetType: 'filePath' - filePath: '$(Build.SourcesDirectory)\release\windows\msi\scripts\pipeline-test.ps1' - failOnStderr: true - env: - CLI_VERSION: $(VERSION_TAG) - ARCHITECTURE: ${{ parameters.Architecture }} - \ No newline at end of file diff --git a/build/azure-pipelines/package-product.yml b/build/azure-pipelines/package-product.yml deleted file mode 100644 index ac6100b9..00000000 --- a/build/azure-pipelines/package-product.yml +++ /dev/null @@ -1,60 +0,0 @@ -# sqlcmd package pipeline - -trigger: none - -pr: none - -variables: - Build.SourcesCliDirectory: '$(Build.SourcesDirectory)/' - MSI_OUTPUT_DIR: '$(Build.SourcesCliDirectory)/output' - -stages: - - stage: CreatePackages - displayName: Create and Test Package Matrix - jobs: - - job: Package - strategy: - matrix: - rpm: - imageName: 'ubuntu-latest' - os: linux - type: rpm - architecture: x86_x64 - debian: - imageName: 'ubuntu-latest' - os: linux - type: deb - architecture: amd64 - docker: - imageName: 'ubuntu-latest' - os: linux - type: docker - architecture: amd64 - windows-x64: - imageName: 'windows-2019' - os: windows - architecture: x64 - type: msi - windows-arm: - imageName: 'windows-2019' - os: windows - architecture: arm - type: msi - windows-arm64: - imageName: 'windows-2019' - os: windows - architecture: arm64 - type: msi - pool: - vmImage: $(imageName) - steps: - - template: package-common-create.yml - parameters: - OS: $(os) - Architecture: $(architecture) - Type: $(type) - - template: package-common-test.yml - parameters: - OS: $(os) - Architecture: $(architecture) - Type: $(type)