diff --git a/.github/workflows/chocolatey.yml b/.github/workflows/chocolatey.yml index 6444ce7..ba85614 100644 --- a/.github/workflows/chocolatey.yml +++ b/.github/workflows/chocolatey.yml @@ -18,7 +18,6 @@ jobs: chocolatey: name: Deploy to chocolatey.org runs-on: windows-latest - if: github.repository == 'openhv/openhv' steps: - name: Clone Repository uses: actions/checkout@v4 @@ -27,16 +26,16 @@ jobs: run: | filename="OpenHV-${{ github.event.inputs.tag }}-x86.exe" url="https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/${filename}" - sed -i "s#{URL32}#${url}#g" "packaging/windows/chocolatey/tools/chocolateyinstall.ps1" - curl -sSL "${url}" -o "packaging/windows/${filename}" - md5=$(cat "packaging/windows/${filename}" | md5sum -) - sed -i "s/{MD5CHECKSUM32}/${md5:0:32}/g" "packaging/windows/chocolatey/tools/chocolateyinstall.ps1" + sed -i "s#{URL32}#${url}#g" "tools/chocolateyinstall.ps1" + curl -sSL "${url}" -o "${filename}" + md5=$(cat "${filename}" | md5sum -) + sed -i "s/{MD5CHECKSUM32}/${md5:0:32}/g" "tools/chocolateyinstall.ps1" filename="OpenHV-${{ github.event.inputs.tag }}-x64.exe" url="https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.tag }}/${filename}" - sed -i "s#{URL64}#${url}#g" "packaging/windows/chocolatey/tools/chocolateyinstall.ps1" - curl -sSL "${url}" -o "packaging/windows/${filename}" - md5=$(cat "packaging/windows/${filename}" | md5sum -) - sed -i "s/{MD5CHECKSUM64}/${md5:0:32}/g" "packaging/windows/chocolatey/tools/chocolateyinstall.ps1" + sed -i "s#{URL64}#${url}#g" "tools/chocolateyinstall.ps1" + curl -sSL "${url}" -o "${filename}" + md5=$(cat "${filename}" | md5sum -) + sed -i "s/{MD5CHECKSUM64}/${md5:0:32}/g" "tools/chocolateyinstall.ps1" - name: Set Version id: version @@ -44,13 +43,13 @@ jobs: tag=${{ github.event.inputs.tag }} version="${tag:0:4}.${tag:4:2}.${tag:6:2}" echo "nuget=$version" >> $GITHUB_OUTPUT - sed -i "s/{VERSION}/${version}/g" "packaging/windows/chocolatey/openhv.nuspec" + sed -i "s/{VERSION}/${version}/g" "openhv.nuspec" - name: Pack Release run: | - choco pack packaging/windows/chocolatey/openhv.nuspec --outputdirectory packaging/windows/chocolatey + choco pack openhv.nuspec --outputdirectory chocolatey - name: Upload Release run: | - package=$(find packaging/windows/chocolatey/ -type f -name "*.nupkg") + package=$(find -type f -name "*.nupkg") choco push $package -s https://push.chocolatey.org/ -k ${{ secrets.CHOCO_KEY }} --allow-unofficial diff --git a/README.md b/README.md new file mode 100644 index 0000000..1415802 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# OpenHV Chocolatey Packages + +Install and update using the [Chocolatey](https://github.com/chocolatey) package manager for Windows. + +## Install + +```powershell +choco install openhv +``` + +## Upgrade + +```powershell +choco upgrade openhv +``` + +## Uninstall + +```powershell +choco uninstall openhv +``` diff --git a/packaging/windows/chocolatey/openhv.nuspec b/openhv.nuspec similarity index 100% rename from packaging/windows/chocolatey/openhv.nuspec rename to openhv.nuspec diff --git a/packaging/windows/chocolatey/tools/chocolateyinstall.ps1 b/tools/chocolateyinstall.ps1 similarity index 100% rename from packaging/windows/chocolatey/tools/chocolateyinstall.ps1 rename to tools/chocolateyinstall.ps1 diff --git a/packaging/windows/chocolatey/tools/chocolateyuninstall.ps1 b/tools/chocolateyuninstall.ps1 similarity index 100% rename from packaging/windows/chocolatey/tools/chocolateyuninstall.ps1 rename to tools/chocolateyuninstall.ps1