-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For now we cache only the PHP SDK, the PHP binaries and the development packs. This already greatly improves the setup performance (it might easily safe a minute or two, in case of cache hits). To be able to use the current PHP revision as part of the cache key, we factor out determine-revision.ps1. We create a separate cache for the PHP-SDK since this likely rarely changes, and since the cached variant is apparently much faster than fetching a GH release of the PHP-SDK. Since clients may not want to use the cache, possibly because they have already a lot of other files in their caches, we explicitly require clients to opt-in via the `cache` input parameter.
- Loading branch information
Showing
4 changed files
with
87 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
param ( | ||
[Parameter(Mandatory)] [String] $version | ||
) | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
$baseurl = "https://downloads.php.net/~windows/releases/archives" | ||
$releases = @{ | ||
"7.0" = "7.0.33" | ||
"7.1" = "7.1.33" | ||
"7.2" = "7.2.34" | ||
"7.3" = "7.3.33" | ||
"7.4" = "7.4.33" | ||
"8.0" = "8.0.30" | ||
} | ||
$phpversion = $releases.$version | ||
if (-not $phpversion) { | ||
$baseurl = "https://downloads.php.net/~windows/releases" | ||
$url = "$baseurl/releases.json" | ||
$releases = Invoke-WebRequest $url | ConvertFrom-Json | ||
$phpversion = $releases.$version.version | ||
if (-not $phpversion) { | ||
$baseurl = "https://downloads.php.net/~windows/qa" | ||
$url = "$baseurl/releases.json" | ||
$releases = Invoke-WebRequest $url | ConvertFrom-Json | ||
$phpversion = $releases.$version.version | ||
if (-not $phpversion) { | ||
throw "unknown version" | ||
} | ||
} | ||
} | ||
|
||
Write-Output "version=$phpversion" >> $Env:GITHUB_OUTPUT | ||
Write-Output "baseurl=$baseurl" >> $Env:GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters