Skip to content

Choco (Windows) release package #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion release/linux/deb/prepare-rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sqlcmd (${CLI_VERSION}-${CLI_VERSION_REVISION:=1}) stable; urgency=low

* Debian package release.

-- sqlcmd tools team <dpgswdist@microsoft.com@microsoft.com> $(date -R)
-- sqlcmd tools team <dpgswdist@microsoft.com> $(date -R)

EOM

Expand Down
26 changes: 26 additions & 0 deletions release/windows/choco/sqlcmd.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>sqlcmd</id>
<version>0.8.1</version>
<title>sqlcmd (Install)</title>
<authors>Microsoft</authors>
<projectUrl>https://docs.microsoft.com/en-us/sql/tools/go-sqlcmd-utility</projectUrl>
<iconUrl>https://github.com/microsoft/go-sqlcmd/blob/main/release/windows/msi/resources/go-sqlcmd_256.png</iconUrl>
<copyright>Copyright (c) Microsoft Corporation</copyright>
<licenseUrl>https://github.com/microsoft/go-sqlcmd/blob/main/LICENSE</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/microsoft/go-sqlcmd</projectSourceUrl>
<packageSourceUrl>https://github.com/microsoft/go-sqlcmd/tree/main/release/windows/choco</packageSourceUrl>
<docsUrl>https://docs.microsoft.com/en-us/sql/tools/go-sqlcmd-utility</docsUrl>
<bugTrackerUrl>https://github.com/microsoft/go-sqlcmd/issues</bugTrackerUrl>
<tags>sqlcmd mssql sqlserver</tags>
<summary>sqlcmd CLI for Microsoft SQL Server and Azure SQL</summary>
<description>sqlcmd is a multi-platform command line experience for Microsoft SQL Server and Azure SQL</description>
<releaseNotes>https://github.com/microsoft/go-sqlcmd/releases/tag/v0.8.1</releaseNotes>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
25 changes: 25 additions & 0 deletions release/windows/choco/tools/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From: https://github.com/microsoft/go-sqlcmd/blob/main/LICENSE

LICENSE

MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
17 changes: 17 additions & 0 deletions release/windows/choco/tools/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Note: Include this file if including binaries you have the right to distribute.
Otherwise delete. this file. If you are the software author, you can change this
mention you are the author of the software.

===DELETE ABOVE THIS LINE AND THIS LINE===
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

follow the direction :-)


VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.

Download .msi from Microsoft Download Center
https://download.microsoft.com/download/d/4/4/d4403a51-2ab7-4ea8-b850-d2710c5e1323/sqlcmd_0.8.1-1.msi

Run checksum -t sha256 -f sqlcmd_0.8.1-1.msi

We are the software vendor (Microsoft)
45 changes: 45 additions & 0 deletions release/windows/choco/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
$ErrorActionPreference = 'Stop';

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = '{{DownloadUrl}}'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is DownloadUrl defined? Is url unused because we only support 64bit on Windows?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I believe so. Should we add support for 32bit as well?

$url64 = 'https://download.microsoft.com/download/d/4/4/d4403a51-2ab7-4ea8-b850-d2710c5e1323/sqlcmd_0.8.1-1.msi'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the script take the sqlcmd version as a parameter?


$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = $toolsDir
fileType = 'MSI'
url = $url
url64bit = $url64

softwareName = 'sqlcmd*'

checksum = '{{Checksum}}'
checksumType = '{{ChecksumType}}'
checksum64 = '03587762932D5A66ACFE15D306FE14645D53BC61162B4DA0D9AF29B4A8A1550D'
checksumType64= 'sha256'

silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($packageName).$($env:chocolateyPackageVersion).MsiInstall.log`""
validExitCodes= @(0, 3010, 1641)
}

Install-ChocolateyPackage @packageArgs