add micro php build

This commit is contained in:
crazywhalecc
2022-05-16 14:01:00 +08:00
parent 4cba2cb8c1
commit 74060cbf27
5 changed files with 73 additions and 7 deletions

View File

@@ -30,10 +30,25 @@ jobs:
fi
- name: Build PHP ${{ matrix.php-versions }} for ${{ matrix.arch }}
run: cd docker/ && docker build . --file Dockerfile --tag static-php --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=${{ matrix.php-versions }}
- name: Build micro PHP distribution ${{ matrix.php-versions }} for ${{ matrix.arch }}
run: |
if [[ "${{ matrix.arch }}" = "x86_64" ]]; then
MAIN_VERSION=$(echo "${{ matrix.php-versions }}" | awk -F. '{print $1}')
if [[ "$MAIN_VERSION" = "8" ]]; then
cd docker/ && docker build . --file Dockerfile --tag static-micro --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=${{ matrix.php-versions }} --build-arg COMPILE_MICRO=yes
fi
fi
- name: Push PHP ${{ matrix.php-versions }} to dist
run: |
mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php cp php-dist/bin/php /dist/
cd dist && tar -zcvf "php-${{ matrix.php-versions }}-static-bin-${{ matrix.arch }}.tar.gz" ./php && rm ./php
cd dist && tar -zcvf "php-${{ matrix.php-versions }}-static-bin-${{ matrix.arch }}.tar.gz" ./php && rm ./php && cd ..
if [[ "${{ matrix.arch }}" = "x86_64" ]]; then
MAIN_VERSION=$(echo "${{ matrix.php-versions }}" | awk -F. '{print $1}')
if [[ "$MAIN_VERSION" = "8" ]]; then
docker run --rm -v $(pwd)/dist:/dist static-micro cp /app/source/php-"${{ matrix.php-versions }}"/sapi/micro/micro.sfx /dist/
cd dist && tar -zcvf "micro-${{ matrix.php-versions }}-${{ matrix.arch }}.tar.gz" ./micro.sfx && rm ./micro.sfx && cd ..
fi
fi
- name: Deploy to Zhamao Server
uses: easingthemes/ssh-deploy@main
env: