Skip to content

Commit

Permalink
Upgrade to PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesChou committed May 3, 2024
1 parent d3fe2bf commit 99fd608
Show file tree
Hide file tree
Showing 14 changed files with 155 additions and 18 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ jobs:
latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build latest version and publish to GitHub Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: mileschou/composer
tags: "latest,8.2"
tags: "latest,8.3"
username: mileschou
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
dockerfile: 8.2/Dockerfile
dockerfile: 8.3/Dockerfile

build:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["8.1", "8.0", "7.4", "7.3", "7.2", "7.1", "7.0", "5.6", "5.5"]
version: ["8.2", "8.1", "8.0", "7.4", "7.3", "7.2", "7.1", "7.0", "5.6", "5.5"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build PHP ${{ matrix.version }} and publish to GitHub Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
Expand All @@ -41,24 +41,24 @@ jobs:
latest_v1:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build latest version and publish to GitHub Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: mileschou/composer
tags: "v1,8.2-v1"
tags: "v1,8.3-v1"
username: mileschou
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
dockerfile: 8.2/v1/Dockerfile
dockerfile: 8.3/v1/Dockerfile

build_v1:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["8.1", "8.0", "7.4", "7.3", "7.2", "7.1", "7.0", "5.6"]
version: ["8.2", "8.1", "8.0", "7.4", "7.3", "7.2", "7.1", "7.0", "5.6"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build PHP ${{ matrix.version }} and publish to GitHub Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
uses: mileschou/composer-action/7.2/install@master
with:
args: --help
php82_v1:
php83_v1:
runs-on: ubuntu-latest
steps:
- name: Composer Action install test
uses: mileschou/composer-action/8.2/v1@master
uses: mileschou/composer-action/8.3/v1@master
with:
args: --help
php_version:
Expand Down
31 changes: 31 additions & 0 deletions 8.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM php:8.3-alpine

LABEL org.opencontainers.image.source="https://github.com/MilesChou/composer-action" \
repository="https://github.com/MilesChou/composer-action" \
maintainer="MilesChou <[email protected]>"

RUN set -xe && \
apk add --no-cache \
git \
tini \
unzip

ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["composer"]
26 changes: 26 additions & 0 deletions 8.3/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

# Ref https://github.com/composer/docker/blob/582c6f4e10b6b8fbf9bc1c5b02d6ec24694fe8d4/2.0/docker-entrypoint.sh

isCommand() {
# Retain backwards compatibility with common CI providers,
# see: https://github.com/composer/docker/issues/107
if [ "$1" = "sh" ]; then
return 1
fi

composer help "$1" > /dev/null 2>&1
}

# check if the first argument passed in looks like a flag
if [ "${1#-}" != "$1" ]; then
set -- /sbin/tini -- composer "$@"
# check if the first argument passed in is composer
elif [ "$1" = 'composer' ]; then
set -- /sbin/tini -- "$@"
# check if the first argument passed in matches a known command
elif isCommand "$1"; then
set -- /sbin/tini -- composer "$@"
fi

exec "$@"
8 changes: 8 additions & 0 deletions 8.3/install/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM ghcr.io/mileschou/composer:8.3

CMD ["install"]
36 changes: 36 additions & 0 deletions 8.3/v1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM php:8.3-alpine

LABEL org.opencontainers.image.source="https://github.com/MilesChou/composer-action" \
repository="https://github.com/MilesChou/composer-action" \
maintainer="MilesChou <[email protected]>"

RUN set -xe && \
apk add --no-cache \
git \
tini \
unzip

ENV COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_MEMORY_LIMIT=-1 \
COMPOSER_HOME=/tmp \
COMPOSER_PATH=/usr/bin/composer

COPY --from=composer:1 /usr/bin/composer /usr/bin/composer

RUN set -xe && \
composer self-update --1 && \
composer global require hirak/prestissimo && \
composer clear-cache

COPY docker-entrypoint /usr/local/bin/docker-entrypoint

WORKDIR /app

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]

CMD ["composer"]
26 changes: 26 additions & 0 deletions 8.3/v1/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh

# Ref https://github.com/composer/docker/blob/582c6f4e10b6b8fbf9bc1c5b02d6ec24694fe8d4/2.0/docker-entrypoint.sh

isCommand() {
# Retain backwards compatibility with common CI providers,
# see: https://github.com/composer/docker/issues/107
if [ "$1" = "sh" ]; then
return 1
fi

composer help "$1" > /dev/null 2>&1
}

# check if the first argument passed in looks like a flag
if [ "${1#-}" != "$1" ]; then
set -- /sbin/tini -- composer "$@"
# check if the first argument passed in is composer
elif [ "$1" = 'composer' ]; then
set -- /sbin/tini -- "$@"
# check if the first argument passed in matches a known command
elif isCommand "$1"; then
set -- /sbin/tini -- composer "$@"
fi

exec "$@"
8 changes: 8 additions & 0 deletions 8.3/v1/install/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM ghcr.io/mileschou/composer:8.3-v1

CMD ["install"]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM php:8.2-alpine
FROM php:8.3-alpine

LABEL org.opencontainers.image.source="https://github.com/MilesChou/composer-action" \
repository="https://github.com/MilesChou/composer-action" \
Expand Down
2 changes: 1 addition & 1 deletion install/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM mileschou/composer:8.2
FROM mileschou/composer:8.3

CMD ["install"]
3 changes: 2 additions & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generated_warning() {
EOH
}

LATEST_VERSION=8.2
LATEST_VERSION=8.3

VERSIONS="
7.2
Expand All @@ -19,6 +19,7 @@ VERSIONS="
8.0
8.1
8.2
8.3
"

for version in ${VERSIONS}; do
Expand Down
3 changes: 2 additions & 1 deletion update_v1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ generated_warning() {
EOH
}

LATEST_VERSION=8.2
LATEST_VERSION=8.3

VERSIONS="
7.2
Expand All @@ -19,6 +19,7 @@ VERSIONS="
8.0
8.1
8.2
8.3
"

for version in ${VERSIONS}; do
Expand Down
2 changes: 1 addition & 1 deletion v1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM php:8.2-alpine
FROM php:8.3-alpine

LABEL org.opencontainers.image.source="https://github.com/MilesChou/composer-action" \
repository="https://github.com/MilesChou/composer-action" \
Expand Down
2 changes: 1 addition & 1 deletion v1/install/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
FROM mileschou/composer:8.2-v1
FROM mileschou/composer:8.3-v1

CMD ["install"]

0 comments on commit 99fd608

Please sign in to comment.