Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- "docs/**"
- "README.md"
- "CONTRIBUTING.md"
- "install.ps1"
- "install.sh"
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
- cron: "0 8 * * *"

permissions:
contents: read
contents: write

Comment thread
dunglas marked this conversation as resolved.
env:
GOTOOLCHAIN: local
Expand All @@ -55,15 +55,24 @@ jobs:

- name: Set FRANKENPHP_VERSION
run: |
$releaseTag = $env:INPUT_REF
if (-not $releaseTag -and $env:GITHUB_EVENT_NAME -eq "schedule") {
$releaseTag = (gh release view --repo php/frankenphp --json tagName --jq '.tagName')
}
Comment thread
dunglas marked this conversation as resolved.
Outdated

if ($env:GITHUB_REF_TYPE -eq "tag") {
$frankenphpVersion = $env:GITHUB_REF_NAME.Substring(1)
} elseif ($env:GITHUB_EVENT_NAME -eq "schedule") {
$frankenphpVersion = $env:GITHUB_REF
} elseif ($releaseTag) {
$frankenphpVersion = $releaseTag
Comment thread
dunglas marked this conversation as resolved.
Outdated
} else {
$frankenphpVersion = $env:GITHUB_SHA
}

"FRANKENPHP_VERSION=$frankenphpVersion" >> $env:GITHUB_ENV
"RELEASE_TAG=$releaseTag" >> $env:GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_REF: ${{ (github.ref_type == 'tag' && github.ref_name) || (github.event_name == 'workflow_dispatch' && inputs.version) || '' }}
Comment thread
dunglas marked this conversation as resolved.
Outdated

- name: Setup Go
uses: actions/setup-go@v6
Expand All @@ -72,7 +81,7 @@ jobs:
cache-dependency-path: |
frankenphp/go.sum
frankenphp/caddy/go.sum
cache: ${{ github.event_name != 'release' }}
cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
check-latest: true

- name: Install Vcpkg Libraries
Expand Down Expand Up @@ -108,7 +117,7 @@ jobs:
$phpZip = "php-$version-Win32-vs17-x64.zip"
$develZip = "php-devel-pack-$version-Win32-vs17-x64.zip"

$dirName = "frankenphp-$env:FRANKENPHP_VERSION-php-$version-Win32-vs17-x64"
$dirName = "frankenphp-windows-x86_64"

"DIR_NAME=$dirName" >> $env:GITHUB_ENV

Expand Down Expand Up @@ -185,23 +194,22 @@ jobs:
Copy-Item frankenphp\vcpkg_installed\x64-windows\bin\pthreadVC3.dll $env:DIR_NAME

- name: Upload Artifact
if: github.event_name != 'release'
if: ${{ !env.RELEASE_TAG }}
uses: actions/upload-artifact@v6
with:
name: ${{ env.DIR_NAME }}
path: ${{ env.DIR_NAME }}
if-no-files-found: error

- name: Zip Release Artifact
if: github.event_name == 'release'
if: ${{ env.RELEASE_TAG }}
run: Compress-Archive -Path "$env:DIR_NAME\*" -DestinationPath "$env:DIR_NAME.zip"

- name: Upload Release Asset
if: github.event_name == 'release'
run: gh release upload $env:GITHUB_EVENT_RELEASE_TAG_NAME "$env:DIR_NAME.zip" --clobber
if: ${{ env.RELEASE_TAG }}
run: gh release upload "$env:RELEASE_TAG" "$env:DIR_NAME.zip" --repo php/frankenphp --clobber
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_EVENT_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}

- name: Run Tests
run: |
Expand Down
21 changes: 2 additions & 19 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,12 @@ if ($env:FRANKENPHP_INSTALL) {
$BinDir = Join-Path $HOME ".frankenphp"
}

Write-Host "Querying latest FrankenPHP release..." -ForegroundColor Cyan

try {
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/php/frankenphp/releases/latest"
} catch {
Write-Host "Could not query GitHub releases: $_" -ForegroundColor Red
exit 1
}

$asset = $release.assets | Where-Object { $_.name -match "Win32-vs17-x64\.zip$" } | Select-Object -First 1

if (-not $asset) {
Write-Host "Could not find a Windows release asset." -ForegroundColor Red
Write-Host "Check https://github.com/php/frankenphp/releases for available downloads." -ForegroundColor Red
exit 1
}

Write-Host "Downloading $($asset.name)..." -ForegroundColor Cyan
Write-Host "Downloading FrankenPHP for Windows (x64)..." -ForegroundColor Cyan

$tmpZip = Join-Path $env:TEMP "frankenphp-windows-$PID.zip"

try {
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $tmpZip
Invoke-WebRequest -Uri "https://github.com/php/frankenphp/releases/latest/download/frankenphp-windows-x86_64.zip" -OutFile $tmpZip
} catch {
Write-Host "Download failed: $_" -ForegroundColor Red
exit 1
Expand Down
12 changes: 1 addition & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,10 @@ CYGWIN_NT* | MSYS_NT* | MINGW*)
exit 1
fi

WIN_ASSET=$(curl -s https://api.github.com/repos/php/frankenphp/releases/latest |
grep -o '"name": *"frankenphp-[^"]*-Win32-vs17-x64\.zip"' | head -1 |
sed 's/"name": *"//;s/"//')

if [ -z "${WIN_ASSET}" ]; then
echo "❗ Could not find a Windows release asset"
echo "❗ Check https://github.com/php/frankenphp/releases for available downloads"
exit 1
fi

echo "📦 Downloading ${bold}FrankenPHP${normal} for Windows (x64):"

TMPZIP="/tmp/frankenphp-windows-$$.zip"
curl -L --progress-bar "https://github.com/php/frankenphp/releases/latest/download/${WIN_ASSET}" -o "${TMPZIP}"
curl -L --progress-bar "https://github.com/php/frankenphp/releases/latest/download/frankenphp-windows-x86_64.zip" -o "${TMPZIP}"
Comment thread
dunglas marked this conversation as resolved.
Outdated

echo "📂 Extracting to ${italic}${BIN_DIR}${normal}..."
if command -v unzip >/dev/null 2>&1; then
Expand Down
Loading