mirror of
https://github.com/shivammathur/setup-php.git
synced 2026-11-19 20:31:57 +00:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe52705681 | ||
|
|
856a08ae41 | ||
|
|
79c01dca53 | ||
|
|
c88b92f82d | ||
|
|
50d992bd5b | ||
|
|
79d58381ae | ||
|
|
a5c0723242 | ||
|
|
25b6ac8dcd | ||
|
|
a95d9d8a2e | ||
|
|
af64993021 |
@@ -26,13 +26,13 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
|
uses: github/codeql-action/init@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
|
||||||
with:
|
with:
|
||||||
config-file: ./.github/codeql/codeql-configuration.yml
|
config-file: ./.github/codeql/codeql-configuration.yml
|
||||||
languages: javascript
|
languages: javascript
|
||||||
|
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
|
uses: github/codeql-action/autobuild@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
|
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup cache environment
|
- name: Setup cache environment
|
||||||
id: cache-env
|
id: cache-env
|
||||||
uses: shivammathur/cache-extensions@d894929efeece5f8d386bd667369b321947064ad # v1
|
uses: shivammathur/cache-extensions@695b1b465eba861efe67cbbc31252c27f5ed253d # v1
|
||||||
with:
|
with:
|
||||||
php-version: ${{ matrix.php-versions || env.default-php-version }}
|
php-version: ${{ matrix.php-versions || env.default-php-version }}
|
||||||
extensions: ${{ env.extensions }}
|
extensions: ${{ env.extensions }}
|
||||||
|
|||||||
@@ -1046,34 +1046,23 @@ Examples of using `setup-php` with various PHP frameworks and packages.
|
|||||||
|
|
||||||
These companies generously provide setup-php their products and services to aid in the development of this project.
|
These companies generously provide setup-php their products and services to aid in the development of this project.
|
||||||
|
|
||||||
<p>
|
<p align="center">
|
||||||
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-light-mode-only">
|
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-light-mode-only"><img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140"></a>
|
||||||
<img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140" height="100">
|
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140"></a>
|
||||||
</a>
|
|
||||||
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only">
|
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/cloudflare.svg" alt="Cloudflare" width="240"></a>
|
||||||
<img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140" height="100">
|
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/cloudflare-white.svg" alt="Cloudflare" width="240"></a>
|
||||||
</a>
|
|
||||||
|
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-light-mode-only"><img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200"></a>
|
||||||
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only">
|
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200"></a>
|
||||||
<img src="https://setup-php.com/sponsors/cloudflare.svg" alt="Cloudflare" width="240" height="80">
|
</p>
|
||||||
</a>
|
|
||||||
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-dark-mode-only">
|
<p align="center">
|
||||||
<img src="https://setup-php.com/sponsors/cloudflare-white.svg" alt="Cloudflare" width="240" height="80">
|
<a target="_blank" href="https://namespace.so/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/namespace.svg?v=2" alt="Namespace" width="180" align="middle"></a>
|
||||||
</a>
|
<a target="_blank" href="https://namespace.so/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/namespace-white.svg?v=2" alt="Namespace" width="180" align="middle"></a>
|
||||||
|
|
||||||
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-light-mode-only">
|
<a target="_blank" href="https://www.blacksmith.sh/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/blacksmith.svg?v=2" alt="Blacksmith" width="180" align="middle"></a>
|
||||||
<img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200" height="80">
|
<a target="_blank" href="https://www.blacksmith.sh/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/blacksmith-white.svg?v=2" alt="Blacksmith" width="180" align="middle"></a>
|
||||||
</a>
|
|
||||||
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-dark-mode-only">
|
|
||||||
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200" height="80">
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-light-mode-only">
|
|
||||||
<img src="https://setup-php.com/sponsors/digitalocean.svg" alt="Digitalocean" width="100" height="100">
|
|
||||||
</a>
|
|
||||||
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-dark-mode-only">
|
|
||||||
<img src="https://setup-php.com/sponsors/digitalocean-white.svg" alt="Digitalocean" width="100" height="100">
|
|
||||||
</a>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
|
Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
|
||||||
|
|||||||
+7
-17
@@ -6,20 +6,15 @@ add_sudo() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to link apt-fast to apt-get
|
# Function to select the package installer.
|
||||||
link_apt_fast() {
|
set_apt_install() {
|
||||||
if ! command -v apt-fast >/dev/null; then
|
local apt=apt-get
|
||||||
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
command -v apt-fast >/dev/null && apt=apt-fast
|
||||||
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
apt_install="sudo $debconf_fix $apt install -y --no-install-recommends -o Dpkg::Options::=--force-confnew"
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup environment for self-hosted runners.
|
# Function to setup environment for self-hosted runners.
|
||||||
self_hosted_helper() {
|
self_hosted_helper() {
|
||||||
if ! command -v apt-fast >/dev/null; then
|
|
||||||
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
|
|
||||||
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
|
|
||||||
fi
|
|
||||||
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
|
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
|
||||||
local packages=()
|
local packages=()
|
||||||
mapfile -t packages < <(filter_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg)
|
mapfile -t packages < <(filter_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg)
|
||||||
@@ -30,16 +25,12 @@ self_hosted_helper() {
|
|||||||
|
|
||||||
# Function to fix broken packages.
|
# Function to fix broken packages.
|
||||||
fix_broken_packages() {
|
fix_broken_packages() {
|
||||||
sudo apt --fix-broken install >/dev/null 2>&1
|
sudo apt --fix-broken install -o Dpkg::Options::=--force-confnew >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to install a package
|
# Function to install a package
|
||||||
install_packages() {
|
install_packages() {
|
||||||
packages=("$@")
|
packages=("$@")
|
||||||
if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then
|
|
||||||
echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1
|
|
||||||
trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit
|
|
||||||
fi
|
|
||||||
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,11 +348,10 @@ version=${1:-'8.5'}
|
|||||||
ini=${2:-'production'}
|
ini=${2:-'production'}
|
||||||
src=${0%/*}/..
|
src=${0%/*}/..
|
||||||
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
||||||
apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends"
|
|
||||||
scripts="$src"/scripts
|
scripts="$src"/scripts
|
||||||
|
|
||||||
add_sudo >/dev/null 2>&1
|
add_sudo >/dev/null 2>&1
|
||||||
link_apt_fast >/dev/null 2>&1
|
set_apt_install >/dev/null 2>&1
|
||||||
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
# shellcheck source=.
|
# shellcheck source=.
|
||||||
|
|||||||
@@ -279,8 +279,12 @@ add_tool() {
|
|||||||
sudo cp -a "$tool_path" "$cache_path"
|
sudo cp -a "$tool_path" "$cache_path"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$status_code" != "200" ] && [ -f "$tool_path.bak" ]; then
|
if [ "$status_code" != "200" ]; then
|
||||||
|
if [ -f "$tool_path.bak" ]; then
|
||||||
sudo mv "$tool_path.bak" "$tool_path"
|
sudo mv "$tool_path.bak" "$tool_path"
|
||||||
|
else
|
||||||
|
sudo rm -f "$tool_path"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
sudo rm -f "$tool_path.bak"
|
sudo rm -f "$tool_path.bak"
|
||||||
fi
|
fi
|
||||||
|
|||||||
+4
-4
@@ -65,10 +65,10 @@ check_builds_cache_runner() {
|
|||||||
local pid=$PPID executable
|
local pid=$PPID executable
|
||||||
while [[ "$pid" =~ ^[0-9]+$ && "$pid" -gt 1 ]]; do
|
while [[ "$pid" =~ ^[0-9]+$ && "$pid" -gt 1 ]]; do
|
||||||
executable="$(readlink -f "/proc/$pid/exe")" || return 1
|
executable="$(readlink -f "/proc/$pid/exe")" || return 1
|
||||||
if [[ "$executable" = */bin/Runner.Worker ]]; then
|
if [[ "$executable" = */bin/Runner.Worker || "$executable" = */bin/Runner.Worker.exe ]]; then
|
||||||
jq -e --arg name "${RUNNER_NAME:-}" \
|
jq -e --arg name "${RUNNER_NAME:-}" \
|
||||||
'.AgentName == $name and (.AgentName | test("^(blacksmith|depot)-"))' \
|
'(.AgentName // .agentName) | . == $name and test("^(blacksmith|depot|nsc-runner)-")' \
|
||||||
"${executable%/bin/Runner.Worker}/.runner" >/dev/null 2>&1
|
"${executable%/bin/*}/.runner" >/dev/null 2>&1
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
pid="$(awk '$1 == "PPid:" {print $2}' "/proc/$pid/status")" || return 1
|
pid="$(awk '$1 == "PPid:" {print $2}' "/proc/$pid/status")" || return 1
|
||||||
@@ -93,7 +93,7 @@ read_env() {
|
|||||||
if [[ $_runner = "self-hosted" && "${use_builds_cache:-false}" = "true" ]]; then
|
if [[ $_runner = "self-hosted" && "${use_builds_cache:-false}" = "true" ]]; then
|
||||||
runner=github
|
runner=github
|
||||||
if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" &&
|
if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" &&
|
||||||
( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot)- ) ]] && check_builds_cache_runner; then
|
( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot|nsc-runner)- ) ]] && check_builds_cache_runner; then
|
||||||
_runner=github
|
_runner=github
|
||||||
builds_cache_warning=true
|
builds_cache_warning=true
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ if($version -eq 'pre') {
|
|||||||
}
|
}
|
||||||
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
|
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
|
||||||
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
|
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
|
||||||
Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1
|
Install-PSPackage VcRedist VcRedist-4.1.527\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/v4.1.527.zip" Get-VcList >$null 2>&1
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if ($version -match $nightly_versions) {
|
if ($version -match $nightly_versions) {
|
||||||
|
|||||||
Reference in New Issue
Block a user