Update chocolatey contrib

This commit is contained in:
Filipe PINTO 2023-01-26 14:08:45 +01:00 committed by fpinto
parent cec9b83e9c
commit 4d2bffb205
No known key found for this signature in database
GPG Key ID: F4F06B068FB00692
3 changed files with 35 additions and 12 deletions

View File

@ -1,11 +1,29 @@
# how to manage hurl chocolatey package # how to manage hurl chocolatey package
Get sha256 sum of the new hurl-x.y.z-win64.zip file
Get latest released version
``` ```
Get-FileHash -Path <path>\hurl-<x>.<y>.<z>-win64.zip $hurl_latest_version=((Invoke-WebRequest -UseBasicParsing https://api.github.com/repos/Orange-OpenSource/hurl/releases/latest).content | ConvertFrom-Json | Select -exp tag_name)
echo ${hurl_latest_version}
``` ```
Update *.nuspec and tools/*.ps1 files with new version and sum values, then execute local installer: Get latest released hurl-x.y.z-win64.zip file's sha256 sum
```
Invoke-WebRequest -UseBasicParsing https://github.com/Orange-OpenSource/hurl/releases/download/${hurl_latest_version}/hurl-${hurl_latest_version}-win64.zip -OutFile C:\Windows\Temp\hurl-latest-win64.zip
$hurl_latest_sha=(Get-FileHash C:\Windows\Temp\hurl-latest-win64.zip).Hash
echo ${hurl_latest_sha}
```
Update choco package files with the latest released version and sha256 sum
```
(Get-Content -Path hurl.nuspec) | foreach{$_.replace('${hurl_latest_version}',${hurl_latest_version})} | Set-Content hurl.nuspec
(Get-Content -Path tools\chocolateyinstall.ps1) | foreach{$_.replace('${hurl_latest_version}',${hurl_latest_version})} | Set-Content tools\chocolateyinstall.ps1
(Get-Content -Path tools\chocolateyinstall.ps1) | foreach{$_.replace('${hurl_latest_sha}',${hurl_latest_sha})} | Set-Content tools\chocolateyinstall.ps1
```
Execute local installer:
``` ```
choco pack choco pack
@ -14,7 +32,7 @@ hurl --version
echo "GET https://google.fr" | hurl --location echo "GET https://google.fr" | hurl --location
``` ```
and finally push package to official chocolatey repository And finally push package to official chocolatey repository
``` ```
choco apikey -k <choco api key> -source https://push.chocolatey.org/ choco apikey -k <choco api key> -source https://push.chocolatey.org/

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata> <metadata>
<id>hurl</id> <id>hurl</id>
<version>{version}</version> <version>${hurl_latest_version}</version>
<title>Hurl</title> <title>Hurl</title>
<authors>Fabrice REIX, Jean Christophe AMIEL, Orange-OpenSource</authors> <authors>Fabrice REIX, Jean Christophe AMIEL, Orange-OpenSource</authors>
<owners>Orange-OpenSource</owners> <owners>Orange-OpenSource</owners>
@ -16,14 +16,19 @@
<bugTrackerUrl>https://github.com/Orange-OpenSource/hurl/issues</bugTrackerUrl> <bugTrackerUrl>https://github.com/Orange-OpenSource/hurl/issues</bugTrackerUrl>
<tags>hurl curl http https cli http-client testing-tool integration-tool automation-tool api-testing cross-platform</tags> <tags>hurl curl http https cli http-client testing-tool integration-tool automation-tool api-testing cross-platform</tags>
<summary>Hurl is a command line tool that runs HTTP requests defined in a simple plain text format</summary> <summary>Hurl is a command line tool that runs HTTP requests defined in a simple plain text format</summary>
<description><![CDATA[ <description>
<![CDATA[
Hurl is a command line tool that runs HTTP requests defined in a simple plain text format. Hurl is a command line tool that runs HTTP requests defined in a simple plain text format.
It can perform requests, capture values and evaluate queries on headers and body response. It can perform requests, capture values and evaluate queries on headers and body response.
Hurl is very versatile: it can be used for both fetching data and testing HTTP sessions. Hurl is very versatile: it can be used for both fetching data and testing HTTP sessions.
]]></description> ]]>
<releaseNotes><![CDATA[ </description>
{changelog} <releaseNotes>
]]></releaseNotes> <![CDATA[
https://github.com/Orange-OpenSource/hurl/blob/master/CHANGELOG.md
]]>
</releaseNotes>
</metadata> </metadata>
<files> <files>
<file src="tools\**" target="tools" /> <file src="tools\**" target="tools" />

View File

@ -5,8 +5,8 @@ $SoftwareName = 'hurl'
$HashArguments = @{ $HashArguments = @{
PackageName = $env:ChocolateyPackageName PackageName = $env:ChocolateyPackageName
UnzipLocation = $(Split-Path -Parent $MyInvocation.MyCommand.Definition) UnzipLocation = $(Split-Path -Parent $MyInvocation.MyCommand.Definition)
Url64 = 'https://github.com/Orange-OpenSource/hurl/releases/download/{version}/hurl-{version}-win64.zip' Url64 = 'https://github.com/Orange-OpenSource/hurl/releases/download/${hurl_latest_version}/hurl-${hurl_latest_version}-win64.zip'
Checksum64 = '{Checksum64}' Checksum64 = '${hurl_latest_sha}'
ChecksumType64 = 'sha256' ChecksumType64 = 'sha256'
} }