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.
This commit is contained in:
Batuhan Taskaya 2022-05-06 20:47:40 +03:00 committed by GitHub
parent ad2b86ccf4
commit dc5274e491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ jobs:
name: Release the Chocolatey name: Release the Chocolatey
runs-on: windows-2019 runs-on: windows-2019
env: env:
package-dir: ./httpie/docs/packaging/windows-chocolatey package-dir: docs\packaging\windows-chocolatey
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -30,9 +30,21 @@ jobs:
run: choco info httpie -s . run: choco info httpie -s .
working-directory: ${{ env.package-dir }} working-directory: ${{ env.package-dir }}
- name: Check the Installation - name: Local installation
run: | run: |
choco install httpie -y -dv -s "'.;https://community.chocolatey.org/api/v2/'" 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 http --version
https --version https --version
httpie --version httpie --version
@ -46,3 +58,4 @@ jobs:
run: | run: |
choco apikey --key $CHOCO_API_KEY --source https://push.chocolatey.org/ choco apikey --key $CHOCO_API_KEY --source https://push.chocolatey.org/
choco push httpie*.nupkg --source https://push.chocolatey.org/ choco push httpie*.nupkg --source https://push.chocolatey.org/
working-directory: ${{ env.package-dir }}