From 1bb6e48beba9484afce7951d21c443a191560fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tsch=C3=B6ggi?= <53406238+tschogge@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:21:28 +0200 Subject: [PATCH 01/20] Update README.md Added the chocolatey installation description --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 5259eac..938ae3a 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,20 @@ This utility changes that. ## Installation +### Chocolatey + +If you want to install pvm without configuring any settings and setting PATH variables, then you can install pvm via (chocolatey)[https://community.chocolatey.org/packages/pvm]. + +Ensure that [Chocolatey](https://chocolatey.org/) is installed on your system. + +You can easily install PVM using Chocolatey. Run the following command in a command prompt or PowerShell with administrative rights: + +```shell +choco install pvm +``` + +### Manual + Download the latest pvm version from the releases page (1.0-alpha-1, it's currently a pre-release). Create the folder `%UserProfile%\.pvm\bin` (e.g. `C:\Users\Harry\.pvm\bin`) and drop the pvm exe in there. Add the folder to your PATH. From 3e2d86a24d406fcda511c1298d08eeff866acdd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tsch=C3=B6ggi?= <53406238+tschogge@users.noreply.github.com> Date: Thu, 5 Jun 2025 14:23:12 +0200 Subject: [PATCH 02/20] Update README.md Fixed a markdown error --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 938ae3a..50a5497 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This utility changes that. ### Chocolatey -If you want to install pvm without configuring any settings and setting PATH variables, then you can install pvm via (chocolatey)[https://community.chocolatey.org/packages/pvm]. +If you want to install pvm without configuring any settings and setting PATH variables, then you can install pvm via [chocolatey](https://community.chocolatey.org/packages/pvm). Ensure that [Chocolatey](https://chocolatey.org/) is installed on your system. From f758bf92a90534e975b63348b4b0597f249a5259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tsch=C3=B6ggi?= <53406238+tschogge@users.noreply.github.com> Date: Fri, 6 Jun 2025 09:09:31 +0200 Subject: [PATCH 03/20] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50a5497..79bda6f 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,14 @@ This utility changes that. ### Chocolatey -If you want to install pvm without configuring any settings and setting PATH variables, then you can install pvm via [chocolatey](https://community.chocolatey.org/packages/pvm). +If you want to install pvm without configuring any settings and setting PATH variables, then you can install pvm via [chocolatey](https://community.chocolatey.org/packages/php-pvm). Ensure that [Chocolatey](https://chocolatey.org/) is installed on your system. You can easily install PVM using Chocolatey. Run the following command in a command prompt or PowerShell with administrative rights: ```shell -choco install pvm +choco install php-pvm ``` ### Manual From fa292c01972b8d2458463adf7eff314937ef4eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tsch=C3=B6ggi?= <53406238+tschogge@users.noreply.github.com> Date: Fri, 6 Jun 2025 09:09:57 +0200 Subject: [PATCH 04/20] Update README.md uppercase c in chocolatey --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79bda6f..92684d6 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ This utility changes that. ### Chocolatey -If you want to install pvm without configuring any settings and setting PATH variables, then you can install pvm via [chocolatey](https://community.chocolatey.org/packages/php-pvm). +If you want to install pvm without configuring any settings and setting PATH variables, then you can install pvm via [Chocolatey](https://community.chocolatey.org/packages/php-pvm). Ensure that [Chocolatey](https://chocolatey.org/) is installed on your system. From af218cc27696102600cb7141ba3ac56699b35944 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:15:09 +0200 Subject: [PATCH 05/20] added choco package --- .github/workflows/choco/LICENSE | 21 +++++++++++ .github/workflows/choco/README.md | 2 + .github/workflows/choco/php-pvm.nuspec | 28 ++++++++++++++ .../choco/tools/chocolateyinstall.ps1 | 36 ++++++++++++++++++ .../choco/tools/chocolateyuninstall.ps1 | 17 +++++++++ .github/workflows/choco/update.ps1 | 37 +++++++++++++++++++ 6 files changed, 141 insertions(+) create mode 100644 .github/workflows/choco/LICENSE create mode 100644 .github/workflows/choco/README.md create mode 100644 .github/workflows/choco/php-pvm.nuspec create mode 100644 .github/workflows/choco/tools/chocolateyinstall.ps1 create mode 100644 .github/workflows/choco/tools/chocolateyuninstall.ps1 create mode 100644 .github/workflows/choco/update.ps1 diff --git a/.github/workflows/choco/LICENSE b/.github/workflows/choco/LICENSE new file mode 100644 index 0000000..8e055c9 --- /dev/null +++ b/.github/workflows/choco/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Harry Bayliss + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.github/workflows/choco/README.md b/.github/workflows/choco/README.md new file mode 100644 index 0000000..96dda46 --- /dev/null +++ b/.github/workflows/choco/README.md @@ -0,0 +1,2 @@ +# php-pvm +The chocolatey package for https://github.com/hjbdev/pvm diff --git a/.github/workflows/choco/php-pvm.nuspec b/.github/workflows/choco/php-pvm.nuspec new file mode 100644 index 0000000..326a0a4 --- /dev/null +++ b/.github/workflows/choco/php-pvm.nuspec @@ -0,0 +1,28 @@ + + + + + php-pvm + 1.2.0 + https://github.com/tschogge/php-pvm + + + pvm + hjbdev,Lotti,ENG3PLabs,oldreposcrapyard,goodjun,OliverWich,EbouBaker + Tschogge + https://github.com/hjbdev/pvm + https://github.com/hjbdev/pvm + https://github.com/hjbdev/pvm + https://github.com/hjbdev/pvm/blob/master/LICENSE + true + https://github.com/hjbdev/pvm/discussions + https://github.com/hjbdev/pvm/discussions + pvm php php-version php-version-manager manager phpversion phpversionmanager + A PHP version manager + A PHP version manager to simply install different PHP versions and easily switch between them. Similar to nvm. Use pvm in the terminal after installation to get started. Repo: https://github.com/hjbdev/pvm + + + + + + diff --git a/.github/workflows/choco/tools/chocolateyinstall.ps1 b/.github/workflows/choco/tools/chocolateyinstall.ps1 new file mode 100644 index 0000000..66bcc1f --- /dev/null +++ b/.github/workflows/choco/tools/chocolateyinstall.ps1 @@ -0,0 +1,36 @@ +$ErrorActionPreference = 'Stop' +$toolName = 'pvm' +$userDataPath = [Environment]::GetFolderPath('UserProfile') +$targetPath = "$userDataPath\.$toolName\bin" +$url64 = 'https://github.com/hjbdev/pvm/releases/download/1.2.0/pvm.exe' +$checksum64 = 'A764F8C2EE58EE4A5B026EEEDEFC044F1C4E3802CA96E4E8D00AF3E6504E831F' + + +if (!(Test-Path $targetPath)) { + New-Item -ItemType Directory -Path $targetPath -Force + Write-Host "Created directory $targetPath" +} + +Install-ChocolateyPath -Path $targetPath -PathType 'Machine' +Write-Host "Added $targetPath to the system PATH" + +$tempFile = "$env:TEMP\pvm.exe" +$packageArgs = @{ + packageName = $env:ChocolateyPackageName + fileType = 'EXE' + url64bit = $url64 + softwareName = "$toolName*" + checksum64 = $checksum64 + checksumType64 = 'sha256' + file = $tempFile +} + +Get-ChocolateyWebFile @packageArgs + +Copy-Item -Path $tempFile -Destination "$targetPath\$toolName.exe" -Force +Write-Host "Copied $toolName.exe to $targetPath" + +if (!(Test-Path "$targetPath\$toolName.exe")) { + Write-Error "Failed to copy pvm.exe to $targetPath" + exit 1 +} \ No newline at end of file diff --git a/.github/workflows/choco/tools/chocolateyuninstall.ps1 b/.github/workflows/choco/tools/chocolateyuninstall.ps1 new file mode 100644 index 0000000..0689027 --- /dev/null +++ b/.github/workflows/choco/tools/chocolateyuninstall.ps1 @@ -0,0 +1,17 @@ +$ErrorActionPreference = 'Stop' +$toolName = "pvm" +$userDataPath = [Environment]::GetFolderPath('UserProfile') +$targetPath = "$userDataPath\.$toolName" + +if (Test-Path $targetPath) { + Remove-Item $targetPath -Force -Recurse + Write-Host "Removed the directory and all its contents from $targetPath" +} + +Uninstall-ChocolateyPath -Path "$targetPath\bin" -PathType "Machine" +Write-Host "Removed $targetPath\bin from the system PATH" + +if (Test-Path "$targetPath\$toolName.exe") { + Write-Host "Failed to remove $targetPath\$toolName.exe" + exit 1 +} \ No newline at end of file diff --git a/.github/workflows/choco/update.ps1 b/.github/workflows/choco/update.ps1 new file mode 100644 index 0000000..288052c --- /dev/null +++ b/.github/workflows/choco/update.ps1 @@ -0,0 +1,37 @@ +Import-Module Chocolatey-AU + +function global:au_BeforeUpdate { + $Latest.Checksum64 = Get-RemoteChecksum $Latest.URL64 +} + +function global:au_GetLatest { + $latestRelease = Invoke-RestMethod -UseBasicParsing -Uri 'https://api.github.com/repos/hjbdev/pvm/releases/latest' + + return @{ + URL64 = $latestRelease.assets.browser_download_url + Version = $latestRelease.tag_name + ChecksumType64 = 'sha256' + Description = 'A PHP version manager to simply install different PHP versions and easily switch between them. Similar to nvm. Use pvm in the terminal after installation to get started. Repo: https://github.com/hjbdev/pvm' + } +} + +function global:au_SearchReplace { + @{ + ".\tools\chocolateyInstall.ps1" = @{ + "(^[$]url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'" + "(^[$]checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'" + "(^\s*checksumType64\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'" + } + + "php-pvm.nuspec" = @{ + "(\).*?(\)" = "`${1}$($Latest.Version)`$2" + } + + } +} + +function global:au_AfterUpdate ($Package) { + choco push $Package.NuspecPath --api-key=$Env:CHOCO_API_KEY +} + +update -ChecksumFor none -NoReadme \ No newline at end of file From 10ba6ae005fef52724064d2a36cde4aacd8c1dfd Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:19:29 +0200 Subject: [PATCH 06/20] github action --- .github/workflows/chocolatey_publish.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/chocolatey_publish.yml diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml new file mode 100644 index 0000000..4d1900d --- /dev/null +++ b/.github/workflows/chocolatey_publish.yml @@ -0,0 +1,22 @@ +name: Publish chocolatey package + +on: + release: + types: [published] + +jobs: + publish: + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Chocolatey-AU + shell: pwsh + run: Install-Module Chocolatey-AU -Force -Scope CurrentUser + + - name: Run update.ps1 + shell: pwsh + env: + CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} + run: .\.github\choco\update.ps1 \ No newline at end of file From 39a52a03f704eb5bc32678f27885804103c2cd40 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:21:44 +0200 Subject: [PATCH 07/20] moved folder --- .github/{workflows => }/choco/LICENSE | 0 .github/{workflows => }/choco/README.md | 0 .github/{workflows => }/choco/php-pvm.nuspec | 0 .github/{workflows => }/choco/tools/chocolateyinstall.ps1 | 0 .github/{workflows => }/choco/tools/chocolateyuninstall.ps1 | 0 .github/{workflows => }/choco/update.ps1 | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => }/choco/LICENSE (100%) rename .github/{workflows => }/choco/README.md (100%) rename .github/{workflows => }/choco/php-pvm.nuspec (100%) rename .github/{workflows => }/choco/tools/chocolateyinstall.ps1 (100%) rename .github/{workflows => }/choco/tools/chocolateyuninstall.ps1 (100%) rename .github/{workflows => }/choco/update.ps1 (100%) diff --git a/.github/workflows/choco/LICENSE b/.github/choco/LICENSE similarity index 100% rename from .github/workflows/choco/LICENSE rename to .github/choco/LICENSE diff --git a/.github/workflows/choco/README.md b/.github/choco/README.md similarity index 100% rename from .github/workflows/choco/README.md rename to .github/choco/README.md diff --git a/.github/workflows/choco/php-pvm.nuspec b/.github/choco/php-pvm.nuspec similarity index 100% rename from .github/workflows/choco/php-pvm.nuspec rename to .github/choco/php-pvm.nuspec diff --git a/.github/workflows/choco/tools/chocolateyinstall.ps1 b/.github/choco/tools/chocolateyinstall.ps1 similarity index 100% rename from .github/workflows/choco/tools/chocolateyinstall.ps1 rename to .github/choco/tools/chocolateyinstall.ps1 diff --git a/.github/workflows/choco/tools/chocolateyuninstall.ps1 b/.github/choco/tools/chocolateyuninstall.ps1 similarity index 100% rename from .github/workflows/choco/tools/chocolateyuninstall.ps1 rename to .github/choco/tools/chocolateyuninstall.ps1 diff --git a/.github/workflows/choco/update.ps1 b/.github/choco/update.ps1 similarity index 100% rename from .github/workflows/choco/update.ps1 rename to .github/choco/update.ps1 From b97f4035d75c6a7e030c5f4566a252095ebef30a Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:26:37 +0200 Subject: [PATCH 08/20] on push try --- .github/workflows/chocolatey_publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml index 4d1900d..8622d48 100644 --- a/.github/workflows/chocolatey_publish.yml +++ b/.github/workflows/chocolatey_publish.yml @@ -1,6 +1,7 @@ name: Publish chocolatey package on: + push: release: types: [published] From ec0273651e18ef56f9a4312f3e9f31ae0ebcf310 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:27:37 +0200 Subject: [PATCH 09/20] change to push --- .github/workflows/chocolatey_publish.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml index 8622d48..468cd13 100644 --- a/.github/workflows/chocolatey_publish.yml +++ b/.github/workflows/chocolatey_publish.yml @@ -1,9 +1,6 @@ name: Publish chocolatey package -on: - push: - release: - types: [published] +on: [push] jobs: publish: From 91567b7e61b800e2e65ecfe88dc6477780189f1b Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:37:48 +0200 Subject: [PATCH 10/20] change working directory --- .github/workflows/chocolatey_publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml index 468cd13..c6d3d52 100644 --- a/.github/workflows/chocolatey_publish.yml +++ b/.github/workflows/chocolatey_publish.yml @@ -17,4 +17,5 @@ jobs: shell: pwsh env: CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} + working-directory: ./.github/choco run: .\.github\choco\update.ps1 \ No newline at end of file From b129294da41c904ff6adee1109810720f89cfc40 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:39:47 +0200 Subject: [PATCH 11/20] change script path --- .github/workflows/chocolatey_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml index c6d3d52..7ec416a 100644 --- a/.github/workflows/chocolatey_publish.yml +++ b/.github/workflows/chocolatey_publish.yml @@ -18,4 +18,4 @@ jobs: env: CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} working-directory: ./.github/choco - run: .\.github\choco\update.ps1 \ No newline at end of file + run: .\update.ps1 \ No newline at end of file From 0d384891861f4246e089371fc3828f533c5d1fb0 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:44:31 +0200 Subject: [PATCH 12/20] add debug options --- .github/choco/update.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/choco/update.ps1 b/.github/choco/update.ps1 index 288052c..8f3d715 100644 --- a/.github/choco/update.ps1 +++ b/.github/choco/update.ps1 @@ -1,6 +1,9 @@ Import-Module Chocolatey-AU function global:au_BeforeUpdate { + Write-Host "Current directory: $(Get-Location)" + Write-Host "Files in directory: $(Get-ChildItem)" + $Latest.Checksum64 = Get-RemoteChecksum $Latest.URL64 } From 6e37d88f6bc7162089655f39faaa59abaeb6307c Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:47:32 +0200 Subject: [PATCH 13/20] add nuspec for updater --- .github/choco/update.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/choco/update.ps1 b/.github/choco/update.ps1 index 8f3d715..2aecdad 100644 --- a/.github/choco/update.ps1 +++ b/.github/choco/update.ps1 @@ -37,4 +37,4 @@ function global:au_AfterUpdate ($Package) { choco push $Package.NuspecPath --api-key=$Env:CHOCO_API_KEY } -update -ChecksumFor none -NoReadme \ No newline at end of file +update -ChecksumFor none -NuspecPath .\php-pvm.nuspec -NoReadme \ No newline at end of file From ad4be2f0ba2814815e2c7684f5ed5ed2d0e9894e Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:49:56 +0200 Subject: [PATCH 14/20] change file structure --- .github/choco/LICENSE | 21 ------------------- .github/choco/README.md | 2 -- .github/workflows/chocolatey_publish.yml | 1 - LICENSE | 2 +- .../choco/php-pvm.nuspec => php-pvm.nuspec | 0 .../tools => tools}/chocolateyinstall.ps1 | 0 .../tools => tools}/chocolateyuninstall.ps1 | 0 .github/choco/update.ps1 => update.ps1 | 0 8 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 .github/choco/LICENSE delete mode 100644 .github/choco/README.md rename .github/choco/php-pvm.nuspec => php-pvm.nuspec (100%) rename {.github/choco/tools => tools}/chocolateyinstall.ps1 (100%) rename {.github/choco/tools => tools}/chocolateyuninstall.ps1 (100%) rename .github/choco/update.ps1 => update.ps1 (100%) diff --git a/.github/choco/LICENSE b/.github/choco/LICENSE deleted file mode 100644 index 8e055c9..0000000 --- a/.github/choco/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2025 Harry Bayliss - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/.github/choco/README.md b/.github/choco/README.md deleted file mode 100644 index 96dda46..0000000 --- a/.github/choco/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# php-pvm -The chocolatey package for https://github.com/hjbdev/pvm diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml index 7ec416a..c7c0656 100644 --- a/.github/workflows/chocolatey_publish.yml +++ b/.github/workflows/chocolatey_publish.yml @@ -17,5 +17,4 @@ jobs: shell: pwsh env: CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} - working-directory: ./.github/choco run: .\update.ps1 \ No newline at end of file diff --git a/LICENSE b/LICENSE index 3fdbef4..8e055c9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Harry Bayliss +Copyright (c) 2025 Harry Bayliss Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/.github/choco/php-pvm.nuspec b/php-pvm.nuspec similarity index 100% rename from .github/choco/php-pvm.nuspec rename to php-pvm.nuspec diff --git a/.github/choco/tools/chocolateyinstall.ps1 b/tools/chocolateyinstall.ps1 similarity index 100% rename from .github/choco/tools/chocolateyinstall.ps1 rename to tools/chocolateyinstall.ps1 diff --git a/.github/choco/tools/chocolateyuninstall.ps1 b/tools/chocolateyuninstall.ps1 similarity index 100% rename from .github/choco/tools/chocolateyuninstall.ps1 rename to tools/chocolateyuninstall.ps1 diff --git a/.github/choco/update.ps1 b/update.ps1 similarity index 100% rename from .github/choco/update.ps1 rename to update.ps1 From b4555ab3fa5f5077a7510754c0994ebb0a975880 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:52:31 +0200 Subject: [PATCH 15/20] remove path, because folder structure was changed --- update.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.ps1 b/update.ps1 index 2aecdad..8f3d715 100644 --- a/update.ps1 +++ b/update.ps1 @@ -37,4 +37,4 @@ function global:au_AfterUpdate ($Package) { choco push $Package.NuspecPath --api-key=$Env:CHOCO_API_KEY } -update -ChecksumFor none -NuspecPath .\php-pvm.nuspec -NoReadme \ No newline at end of file +update -ChecksumFor none -NoReadme \ No newline at end of file From 1cb3b229a3d946ec95a7cdb9bf9a8d47703fc503 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 15:57:06 +0200 Subject: [PATCH 16/20] add debug --- update.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/update.ps1 b/update.ps1 index 8f3d715..37f73c9 100644 --- a/update.ps1 +++ b/update.ps1 @@ -1,9 +1,10 @@ Import-Module Chocolatey-AU -function global:au_BeforeUpdate { - Write-Host "Current directory: $(Get-Location)" - Write-Host "Files in directory: $(Get-ChildItem)" +Write-Host "Current directory: $(Get-Location)" +Write-Host "Files in directory: $(Get-ChildItem)" +Write-Host "Nuspec file exists: $(Test-Path .\php-pvm.nuspec)" +function global:au_BeforeUpdate { $Latest.Checksum64 = Get-RemoteChecksum $Latest.URL64 } From 39a7f3b285ccb53bfb60bd823a78de172e0a4d06 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 16:08:22 +0200 Subject: [PATCH 17/20] change to path to maybe make it work --- update.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update.ps1 b/update.ps1 index 37f73c9..ce2c10e 100644 --- a/update.ps1 +++ b/update.ps1 @@ -27,7 +27,7 @@ function global:au_SearchReplace { "(^\s*checksumType64\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'" } - "php-pvm.nuspec" = @{ + ".\php-pvm.nuspec" = @{ "(\).*?(\)" = "`${1}$($Latest.Version)`$2" } From 1557d4119b796e0704587b71dbe7720b03351d08 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 16:20:53 +0200 Subject: [PATCH 18/20] try only copying files --- .github/workflows/chocolatey_publish.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml index c7c0656..06ec37a 100644 --- a/.github/workflows/chocolatey_publish.yml +++ b/.github/workflows/chocolatey_publish.yml @@ -13,8 +13,18 @@ jobs: shell: pwsh run: Install-Module Chocolatey-AU -Force -Scope CurrentUser + - name: Prepare chocolatey package + shell: pwsh + run: | + # Erstelle temp directory für chocolatey package + New-Item -ItemType Directory -Path "chocolatey_package" -Force + Copy-Item "php-pvm.nuspec" "chocolatey_package/" + Copy-Item "update.ps1" "chocolatey_package/" + Copy-Item -Recurse "tools" "chocolatey_package/" + - name: Run update.ps1 shell: pwsh env: CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} + working-directory: ./chocolatey_package run: .\update.ps1 \ No newline at end of file From 66c7a629db2ef9edf55620082c478becd7403eb8 Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 16:41:40 +0200 Subject: [PATCH 19/20] fixed problem with foldername --- .github/workflows/chocolatey_publish.yml | 11 +---------- php-pvm.nuspec => php-pvm/php-pvm.nuspec | 2 +- {tools => php-pvm/tools}/chocolateyinstall.ps1 | 0 {tools => php-pvm/tools}/chocolateyuninstall.ps1 | 0 update.ps1 => php-pvm/update.ps1 | 6 +----- 5 files changed, 3 insertions(+), 16 deletions(-) rename php-pvm.nuspec => php-pvm/php-pvm.nuspec (98%) rename {tools => php-pvm/tools}/chocolateyinstall.ps1 (100%) rename {tools => php-pvm/tools}/chocolateyuninstall.ps1 (100%) rename update.ps1 => php-pvm/update.ps1 (85%) diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml index 06ec37a..0e1e860 100644 --- a/.github/workflows/chocolatey_publish.yml +++ b/.github/workflows/chocolatey_publish.yml @@ -13,18 +13,9 @@ jobs: shell: pwsh run: Install-Module Chocolatey-AU -Force -Scope CurrentUser - - name: Prepare chocolatey package - shell: pwsh - run: | - # Erstelle temp directory für chocolatey package - New-Item -ItemType Directory -Path "chocolatey_package" -Force - Copy-Item "php-pvm.nuspec" "chocolatey_package/" - Copy-Item "update.ps1" "chocolatey_package/" - Copy-Item -Recurse "tools" "chocolatey_package/" - - name: Run update.ps1 shell: pwsh env: CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} - working-directory: ./chocolatey_package + working-directory: ./php-pvm run: .\update.ps1 \ No newline at end of file diff --git a/php-pvm.nuspec b/php-pvm/php-pvm.nuspec similarity index 98% rename from php-pvm.nuspec rename to php-pvm/php-pvm.nuspec index 326a0a4..96609b1 100644 --- a/php-pvm.nuspec +++ b/php-pvm/php-pvm.nuspec @@ -3,7 +3,7 @@ php-pvm - 1.2.0 + 1.2.1 https://github.com/tschogge/php-pvm diff --git a/tools/chocolateyinstall.ps1 b/php-pvm/tools/chocolateyinstall.ps1 similarity index 100% rename from tools/chocolateyinstall.ps1 rename to php-pvm/tools/chocolateyinstall.ps1 diff --git a/tools/chocolateyuninstall.ps1 b/php-pvm/tools/chocolateyuninstall.ps1 similarity index 100% rename from tools/chocolateyuninstall.ps1 rename to php-pvm/tools/chocolateyuninstall.ps1 diff --git a/update.ps1 b/php-pvm/update.ps1 similarity index 85% rename from update.ps1 rename to php-pvm/update.ps1 index ce2c10e..288052c 100644 --- a/update.ps1 +++ b/php-pvm/update.ps1 @@ -1,9 +1,5 @@ Import-Module Chocolatey-AU -Write-Host "Current directory: $(Get-Location)" -Write-Host "Files in directory: $(Get-ChildItem)" -Write-Host "Nuspec file exists: $(Test-Path .\php-pvm.nuspec)" - function global:au_BeforeUpdate { $Latest.Checksum64 = Get-RemoteChecksum $Latest.URL64 } @@ -27,7 +23,7 @@ function global:au_SearchReplace { "(^\s*checksumType64\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'" } - ".\php-pvm.nuspec" = @{ + "php-pvm.nuspec" = @{ "(\).*?(\)" = "`${1}$($Latest.Version)`$2" } From ada17d58e258980ee55627aaab61dad90be344de Mon Sep 17 00:00:00 2001 From: Giotsche Date: Wed, 1 Oct 2025 16:43:31 +0200 Subject: [PATCH 20/20] done --- .github/workflows/chocolatey_publish.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chocolatey_publish.yml b/.github/workflows/chocolatey_publish.yml index 0e1e860..0ee4e1c 100644 --- a/.github/workflows/chocolatey_publish.yml +++ b/.github/workflows/chocolatey_publish.yml @@ -1,6 +1,8 @@ name: Publish chocolatey package -on: [push] +on: + release: + types: [published] jobs: publish: