Skip to content

Commit a7699e4

Browse files
committed
Add manual build for 7.4, 8.0 and 8.1
1 parent 0e4c2cd commit a7699e4

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

.github/workflows/legacy-v5.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Direct build v5 of legacy php
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test-and-publish:
8+
runs-on: ubuntu-latest
9+
name: Publish ${{ matrix.php_version }}-${{ matrix.variant }} multi-arch to dockerhub
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
php_version: ['8.1', '8.0', '7.4']
14+
variant: ['apache','cli','fpm']
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v3
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
- name: Login to DockerHub
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
- name: Fetch minor version of php
28+
run: |
29+
# Build slim one
30+
PHP_VERSION="${{ matrix.php_version }}"
31+
TAG_PREFIX="rc${GITHUB_RUN_ID}-" \
32+
docker buildx bake \
33+
--set "*.platform=linux/amd64" \
34+
--set "*.output=type=docker" \
35+
--load \
36+
php${PHP_VERSION//.}-slim-${{ matrix.variant }}
37+
# Retrieve minor
38+
PHP_PATCH_MINOR=`docker run --rm thecodingmachine/php:rc${GITHUB_RUN_ID}-${{ matrix.php_version }}-v5-slim-${{ matrix.variant }} php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1`
39+
echo "PHP_PATCH_MINOR=${PHP_PATCH_MINOR}" >> $GITHUB_ENV
40+
- name: Display tags to build
41+
run: |
42+
PHP_VERSION="${{ matrix.php_version }}"
43+
PHP_PATCH_MINOR="${{ env.PHP_PATCH_MINOR }}" \
44+
TAG_PREFIX="rc${GITHUB_RUN_ID}-" \
45+
IS_RELEASE="1" \
46+
docker buildx bake php${PHP_VERSION//.}-${{ matrix.variant }}-all --print --progress plain | jq ".target[].tags | join(\" \")" -r > "/tmp/tags.log"
47+
cat "/tmp/tags.log"
48+
- name: Build and push ${{ matrix.php_version }}-${{ matrix.variant }}
49+
run: |
50+
PHP_VERSION="${{ matrix.php_version }}"
51+
PHP_PATCH_MINOR="${{ env.PHP_PATCH_MINOR }}" \
52+
TAG_PREFIX="rc${GITHUB_RUN_ID}-" \
53+
IS_RELEASE="1" \
54+
docker buildx bake \
55+
--set "*.platform=linux/amd64,linux/arm64" \
56+
--set "*.output=type=registry" \
57+
php${PHP_VERSION//.}-${{ matrix.variant }}-all
58+
- name: Push artifacts
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: ${{ matrix.php_version }}-${{ matrix.variant }}
62+
path: /tmp/tags.log
63+
retention-days: 60

.github/workflows/legacy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
5252
publish:
5353
# push ~ schedule
54-
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
54+
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
5555
needs:
5656
- test
5757
runs-on: ubuntu-latest

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
5858
publish:
5959
# push ~ schedule
60-
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
60+
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
6161
needs:
6262
- test
6363
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)