2022-01-14 06:25:53 +08:00
|
|
|
name: dependency-updates
|
|
|
|
|
|
|
|
on:
|
2022-12-05 17:34:33 +08:00
|
|
|
workflow_dispatch:
|
2022-01-14 06:25:53 +08:00
|
|
|
schedule:
|
|
|
|
- cron: '00 12 * * *'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
dependency_updates:
|
|
|
|
name: Run dependency update script
|
2022-12-05 17:34:33 +08:00
|
|
|
runs-on: ubuntu-20.04
|
2022-01-14 06:25:53 +08:00
|
|
|
steps:
|
2022-03-30 19:34:46 +08:00
|
|
|
- uses: actions/checkout@v3
|
2023-01-13 20:26:38 +08:00
|
|
|
- uses: shivammathur/setup-php@v2
|
2022-01-14 06:25:53 +08:00
|
|
|
with:
|
2022-12-24 00:02:47 +08:00
|
|
|
php-version: 8.1
|
2022-12-03 23:05:38 +08:00
|
|
|
extensions: apcu
|
2022-01-14 06:25:53 +08:00
|
|
|
- name: Run dependency update script
|
|
|
|
run: |
|
2022-01-29 20:26:23 +08:00
|
|
|
set -x
|
2022-01-14 06:25:53 +08:00
|
|
|
cd ./php
|
|
|
|
composer update
|
2022-02-03 17:11:16 +08:00
|
|
|
set +e
|
2023-01-16 00:46:38 +08:00
|
|
|
ALL_LINES="$(composer outdated | grep -v "^$\|Direct dependencies\|Everything up to date\|Transitive dependencies")"
|
2022-02-03 17:11:16 +08:00
|
|
|
set -e
|
|
|
|
while [ -n "$ALL_LINES" ]; do
|
|
|
|
CURRENT_LINE="$(echo "$ALL_LINES" | head -1)"
|
2023-01-13 20:26:38 +08:00
|
|
|
composer require "$(echo "$CURRENT_LINE" | awk '{print $1}')" "^$(echo "$CURRENT_LINE" | awk '{print $4}')" --with-all-dependencies
|
2022-02-03 17:11:16 +08:00
|
|
|
ALL_LINES="$(echo "$ALL_LINES" | sed '1d')"
|
|
|
|
done
|
2022-01-14 06:25:53 +08:00
|
|
|
echo "outdated dependencies:
|
|
|
|
$(composer outdated)"
|
2022-03-14 23:25:47 +08:00
|
|
|
- name: Update apcu
|
|
|
|
run: |
|
|
|
|
# APCU
|
|
|
|
apcu_version="$(
|
|
|
|
git ls-remote --tags https://github.com/krakjoe/apcu.git \
|
|
|
|
| cut -d/ -f3 \
|
2022-04-23 00:00:35 +08:00
|
|
|
| grep -viE -- 'rc|b' \
|
2022-03-14 23:25:47 +08:00
|
|
|
| sed -E 's/^v//' \
|
|
|
|
| sort -V \
|
|
|
|
| tail -1
|
|
|
|
)"
|
|
|
|
sed -i "s|pecl install APCu.*\;|pecl install APCu-$apcu_version\;|" ./Containers/mastercontainer/Dockerfile
|
2022-01-14 06:25:53 +08:00
|
|
|
- name: Create Pull Request
|
2022-03-30 19:34:41 +08:00
|
|
|
uses: peter-evans/create-pull-request@v4
|
2022-01-14 06:25:53 +08:00
|
|
|
with:
|
|
|
|
commit-message: dependency updates
|
|
|
|
signoff: true
|
|
|
|
title: Dependency updates
|
|
|
|
body: Automated dependency updates since dependabot does not support grouped updates
|
|
|
|
labels: dependencies, enhancement
|
|
|
|
milestone: next
|
2022-01-18 21:30:47 +08:00
|
|
|
branch: aio-dependency-update
|