From 9dda23a32215ce233f9a5384030ddc7eb9e231b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Thu, 7 Oct 2021 13:53:11 +0200 Subject: [PATCH] Add Chocolatey packaging information (#1172) * Add Chocolatey packaging information * Fix working directory * Fix Python dependency * Update icon URL * Fix local installation * Simplify links * Remove the workflow, it adds no real value and th etime to fix is is not worth --- .gitignore | 3 ++ docs/packaging/README.md | 30 ++++++------ docs/packaging/windows-chocolatey/README.md | 29 ++++++++++- .../windows-chocolatey/httpie.nuspec | 49 +++++++++++++++++++ .../tools/chocolateyinstall.ps1 | 6 +++ .../tools/chocolateyuninstall.ps1 | 2 + snapcraft.yaml | 2 +- 7 files changed, 103 insertions(+), 18 deletions(-) create mode 100644 docs/packaging/windows-chocolatey/httpie.nuspec create mode 100644 docs/packaging/windows-chocolatey/tools/chocolateyinstall.ps1 create mode 100644 docs/packaging/windows-chocolatey/tools/chocolateyuninstall.ps1 diff --git a/.gitignore b/.gitignore index 83aed325..4f4d9454 100644 --- a/.gitignore +++ b/.gitignore @@ -148,3 +148,6 @@ dmypy.json # VS Code .vscode/ + +# Windows Chocolatey +*.nupkg diff --git a/docs/packaging/README.md b/docs/packaging/README.md index 0f329368..5cc10745 100644 --- a/docs/packaging/README.md +++ b/docs/packaging/README.md @@ -30,20 +30,20 @@ That is done quite easily by manually triggering the [release workflow](https:// Find out how we do release new versions for each and every supported OS in the following table. A more complete state of deployment can be found on [repology](https://repology.org/project/httpie/versions), including unofficial packages. -| OS | Maintainer | -| ------------------------------------------------------------------: | -------------- | -| [Alpine](linux-alpine/README.md) | **HTTPie** | -| [Arch Linux, and derived](linux-arch/README.md) | trusted person | -| :construction: [AOSC OS](linux-aosc/README.md) | **HTTPie** | -| [CentOS, RHEL, and derived](linux-centos/README.md) | trusted person | -| [Debian, Ubuntu, and derived](linux-debian/README.md) | trusted person | -| [Fedora](linux-fedora/README.md) | trusted person | -| [Gentoo](linux-gentoo/README.md) | **HTTPie** | -| :construction: [Homebrew, Linuxbrew](brew/README.md) | **HTTPie** | -| :construction: [MacPorts](mac-ports/README.md) | **HTTPie** | -| [Snapcraft](snapcraft/README.md) | **HTTPie** | -| [Spack](spack/README.md) | **HTTPie** | -| [Void Linux](linux-void/README.md) | **HTTPie** | -| :construction: [Windows — Chocolatey](windows-chocolatey/README.md) | **HTTPie** | +| OS | Maintainer | +| -------------------------------------------: | -------------- | +| [Alpine](linux-alpine/) | **HTTPie** | +| [Arch Linux, and derived](linux-arch/) | trusted person | +| :construction: [AOSC OS](linux-aosc/) | **HTTPie** | +| [CentOS, RHEL, and derived](linux-centos/) | trusted person | +| [Debian, Ubuntu, and derived](linux-debian/) | trusted person | +| [Fedora](linux-fedora/) | trusted person | +| [Gentoo](linux-gentoo/) | **HTTPie** | +| :construction: [Homebrew, Linuxbrew](brew/) | **HTTPie** | +| :construction: [MacPorts](mac-ports/) | **HTTPie** | +| [Snapcraft](snapcraft/) | **HTTPie** | +| [Spack](spack/) | **HTTPie** | +| [Void Linux](linux-void/) | **HTTPie** | +| [Windows — Chocolatey](windows-chocolatey/) | **HTTPie** | :new: You do not find your system or you would like to see HTTPie supported on another OS? Then [let us know](https://github.com/httpie/httpie/issues/). diff --git a/docs/packaging/windows-chocolatey/README.md b/docs/packaging/windows-chocolatey/README.md index 11028341..ff18b536 100644 --- a/docs/packaging/windows-chocolatey/README.md +++ b/docs/packaging/windows-chocolatey/README.md @@ -13,8 +13,33 @@ We will discuss setting up the environment, installing development tools, instal ## Overall process -:construction: Work in progress. +After having successfully [built and tested](#hacking) the package, push it: + +```bash +# Replace 2.5.0 with the correct version +choco push httpie.2.5.0.nupkg -s https://push.chocolatey.org/ +``` ## Hacking -:construction: Work in progress. +```bash +# Clone +git clone --depth=1 https://github.com/httpie/httpie.git +cd httpie/docs/packaging/windows-chocolatey + +# Build +choco pack + +# Check metadata +choco info httpie -s . + +# Install +choco install httpie -y -dv -s "'.;https://community.chocolatey.org/api/v2/'" + +# Test +http --version +https --version + +# Remove +choco uninstall -y httpie +``` diff --git a/docs/packaging/windows-chocolatey/httpie.nuspec b/docs/packaging/windows-chocolatey/httpie.nuspec new file mode 100644 index 00000000..c6302765 --- /dev/null +++ b/docs/packaging/windows-chocolatey/httpie.nuspec @@ -0,0 +1,49 @@ + + + + httpie + 2.5.0 + +HTTPie *aitch-tee-tee-pie* is a user-friendly command-line HTTP client for the API era. +It comes with JSON support, syntax highlighting, persistent sessions, wget-like downloads, plugins, and more. + +The project's goal is to make CLI interaction with web services as human-friendly as possible. HTTPie is designed for testing, debugging, and generally interacting with APIs and HTTP servers. +The `http` and `https` commands allow for creating and sending arbitrary HTTP requests. They use simple and natural syntax and provide formatted and colorized output. + +Main features: + +- Built-in JSON support +- Colorized and formatted terminal output +- Sensible defaults for the API era +- Persistent sessions +- Forms and file uploads +- HTTPS, proxies, and authentication support +- Support for arbitrary request data and headers +- Wget-like downloads +- Extensions API +- Expressive and intuitive syntax +- Linux, macOS, Windows, and FreeBSD support +- All that and more in 2 simple commands: `http` + `https` + + HTTPie + HTTPie + Tiger-222 + 2012-2021 Jakub Roztocil + https://raw.githubusercontent.com/httpie/httpie/master/LICENSE + https://pie-assets.s3.eu-central-1.amazonaws.com/LogoIcons/GB.png + false + See the [changelog](https://github.com/httpie/httpie/blob/2.5.0/CHANGELOG.md). + httpie http https rest api client curl python ssl cli foss oss url + https://httpie.io + https://github.com/httpie/httpie + https://github.com/httpie/httpie + https://httpie.io/docs + https://github.com/httpie/httpie/issues + + + + + + + + diff --git a/docs/packaging/windows-chocolatey/tools/chocolateyinstall.ps1 b/docs/packaging/windows-chocolatey/tools/chocolateyinstall.ps1 new file mode 100644 index 00000000..36f3b195 --- /dev/null +++ b/docs/packaging/windows-chocolatey/tools/chocolateyinstall.ps1 @@ -0,0 +1,6 @@ +$ErrorActionPreference = 'Stop'; +$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" +$nuspecPath = "$(Join-Path (Split-Path -parent $toolsDir) ($env:ChocolateyPackageName + ".nuspec"))" +[XML]$nuspec = Get-Content $nuspecPath +$pipVersion = $nuspec.package.metadata.version +py -m pip install "$($env:ChocolateyPackageName)==$($pipVersion)" --disable-pip-version-check diff --git a/docs/packaging/windows-chocolatey/tools/chocolateyuninstall.ps1 b/docs/packaging/windows-chocolatey/tools/chocolateyuninstall.ps1 new file mode 100644 index 00000000..59c660b5 --- /dev/null +++ b/docs/packaging/windows-chocolatey/tools/chocolateyuninstall.ps1 @@ -0,0 +1,2 @@ +$ErrorActionPreference = 'Stop'; +py -m pip uninstall -y $env:ChocolateyPackageName --disable-pip-version-check diff --git a/snapcraft.yaml b/snapcraft.yaml index ef72a810..0b9b07d8 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -25,7 +25,7 @@ description: | - Wget-like downloads - Extensions API - Expressive and intuitive syntax - - Linux, macOS, and Windows support + - Linux, macOS, Windows, and FreeBSD support - All that & more in 2 simple commands: http + https Links