-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2cb825
commit c687c62
Showing
2 changed files
with
44 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: 'Cache PHP' | ||
on: | ||
workflow_dispatch: | ||
jobs: | ||
cache: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Create artifact directory | ||
run: mkdir builds | ||
- name: Fetch files | ||
run: bash scripts/fetch.sh ${{ matrix.php }} builds | ||
- name: Update release | ||
run: | | ||
set -x | ||
assets=() | ||
for asset in ./builds/*; do | ||
assets+=("$asset") | ||
done | ||
for release in php${{ matrix.php }}; do | ||
if ! gh release view "$release"; then | ||
gh release create "$release" "${assets[@]}" -t "$release" -n "$release" | ||
else | ||
gh release upload "$release" "${assets[@]}" --clobber | ||
fi | ||
done | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,12 @@ | ||
version=$1 | ||
directory=$2 | ||
( | ||
cd "$directory" || exit 1 | ||
trunk=https://windows.php.net/downloads/releases | ||
semver=$(curl -sL "$trunk"/releases.json | jq -r ".[\"$version\"].version") | ||
if [ "$version" != "${semver%.*}" ]; then | ||
semver=$(curl -sL "$trunk"/archives/ | grep -Po '(?<=HREF=")[^"]*' | grep -Po "$version.[0-9]+" | sort -V | tail -1) | ||
trunk="$trunk"/archives | ||
fi | ||
curl -sL "$trunk" | grep -Po '(?<=HREF=")[^"]*' | grep -E "$semver" | xargs -n 1 -I{} curl -sLO https://windows.php.net/{} | ||
) |