From dc5274e491b48d8294d530eb12186df28bf9d1b7 Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Fri, 6 May 2022 20:47:40 +0300 Subject: [PATCH] Use the proper directory name for the choco action. (#1392) * Use the proper directory name for the choco action. * Refresh the current environment to reflect the new installation. --- .github/workflows/release-choco.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-choco.yml b/.github/workflows/release-choco.yml index 09b5393d..01e0c406 100644 --- a/.github/workflows/release-choco.yml +++ b/.github/workflows/release-choco.yml @@ -13,7 +13,7 @@ jobs: name: Release the Chocolatey runs-on: windows-2019 env: - package-dir: ./httpie/docs/packaging/windows-chocolatey + package-dir: docs\packaging\windows-chocolatey steps: - uses: actions/checkout@v3 @@ -30,9 +30,21 @@ jobs: run: choco info httpie -s . working-directory: ${{ env.package-dir }} - - name: Check the Installation + - name: Local installation run: | choco install httpie -y -dv -s "'.;https://community.chocolatey.org/api/v2/'" + working-directory: ${{ env.package-dir }} + + - name: Test the locally installed binaries + run: | + # Source: https://stackoverflow.com/a/46760714/15330941 + + # Make `refreshenv` available right away, by defining the $env:ChocolateyInstall + # variable and importing the Chocolatey profile module. + $env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.." + Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" + refreshenv + http --version https --version httpie --version @@ -46,3 +58,4 @@ jobs: run: | choco apikey --key $CHOCO_API_KEY --source https://push.chocolatey.org/ choco push httpie*.nupkg --source https://push.chocolatey.org/ + working-directory: ${{ env.package-dir }}