From 0635341f43ef6c88dcc7d967bfe3d7c88b3149b8 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Tue, 31 Aug 2021 10:47:03 +0800 Subject: [PATCH] separate action scripts --- .github/workflows/docker-image.yml | 75 ------------------------------ .github/workflows/php-7.2.yml | 40 ++++++++++++++++ .github/workflows/php-7.3.yml | 40 ++++++++++++++++ .github/workflows/php-7.4.yml | 40 ++++++++++++++++ .github/workflows/php-8.0.yml | 40 ++++++++++++++++ action-deploy.sh | 30 ------------ docker/fast-compiler.sh | 2 +- 7 files changed, 161 insertions(+), 106 deletions(-) delete mode 100644 .github/workflows/docker-image.yml create mode 100644 .github/workflows/php-7.2.yml create mode 100644 .github/workflows/php-7.3.yml create mode 100644 .github/workflows/php-7.4.yml create mode 100644 .github/workflows/php-8.0.yml delete mode 100644 action-deploy.sh diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 49849e20..00000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Build PHP 7.2 - run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.2 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.2.34 - - name: Push PHP 7.2 to dist - run: | - mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php:7.2 cp php-dist/bin/php /dist/ - mkdir dist/7.2 && mv dist/php dist/7.2/ - - name: Build PHP 7.3 - run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.3 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.3.30 - - name: Push PHP 7.3 to dist - run: | - docker run --rm -v $(pwd)/dist:/dist/ static-php:7.3 cp php-dist/bin/php /dist/ - mkdir dist/7.3 && mv dist/php dist/7.3/ - - name: Build PHP 7.4 - run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.4 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.4.23 - - name: Push PHP 7.4 to dist - run: | - docker run --rm -v $(pwd)/dist:/dist/ static-php:7.4 cp php-dist/bin/php /dist/ - mkdir dist/7.4 && mv dist/php dist/7.4/ - - name: Build PHP 8.0 - run: cd docker/ && docker build . --file Dockerfile --tag static-php:8.0 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=8.0.10 - - name: Push PHP 8.0 to dist - run: | - docker run --rm -v $(pwd)/dist:/dist/ static-php:8.0 cp php-dist/bin/php /dist/ - mkdir dist/8.0 && mv dist/php dist/8.0/ - - name: Change Dockerfile to aarch64 - run: cd docker/ && sed -ie 's/alpine:latest/multiarch\/alpine:aarch64-edge/g' Dockerfile && docker run --rm --privileged multiarch/qemu-user-static:register --reset - - name: Build PHP 7.2 arm - run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.2-aarch64 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.2.34 - - name: Push PHP 7.2 to dist - run: | - docker run --rm -v $(pwd)/dist:/dist/ static-php:7.2-aarch64 cp php-dist/bin/php /dist/ - mkdir dist/7.2-aarch64 && mv dist/php dist/7.2-aarch64/ - - name: Build PHP 7.3 arm - run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.3-aarch64 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.3.30 - - name: Push PHP 7.3 to dist - run: | - docker run --rm -v $(pwd)/dist:/dist/ static-php:7.3-aarch64 cp php-dist/bin/php /dist/ - mkdir dist/7.3-aarch64 && mv dist/php dist/7.3-aarch64/ - - name: Build PHP 7.4 arm - run: cd docker/ && docker build . --file Dockerfile --tag static-php:7.4-aarch64 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.4.23 - - name: Push PHP 7.4 to dist - run: | - docker run --rm -v $(pwd)/dist:/dist/ static-php:7.4-aarch64 cp php-dist/bin/php /dist/ - mkdir dist/7.4-aarch64 && mv dist/php dist/7.4-aarch64/ - - name: Build PHP 8.0 arm - run: cd docker/ && docker build . --file Dockerfile --tag static-php:8.0-aarch64 --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=8.0.10 - - name: Push PHP 8.0 to dist - run: | - docker run --rm -v $(pwd)/dist:/dist/ static-php:8.0-aarch64 cp php-dist/bin/php /dist/ - mkdir dist/8.0-aarch64 && mv dist/php dist/8.0-aarch64/ - - name: Deploy to Zhamao Server - uses: easingthemes/ssh-deploy@main - env: - SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SERVER_SECRET_KEY }} - ARGS: "-rltgoDzvO --delete" - SOURCE: "dist/" - REMOTE_HOST: ${{ secrets.DEPLOY_SERVER_HOST }} - REMOTE_USER: ${{ secrets.DEPLOY_SERVER_USER }} - TARGET: ${{ secrets.DEPLOY_SERVER_TARGET }} diff --git a/.github/workflows/php-7.2.yml b/.github/workflows/php-7.2.yml new file mode 100644 index 00000000..869a4df6 --- /dev/null +++ b/.github/workflows/php-7.2.yml @@ -0,0 +1,40 @@ +name: Build PHP 7.2.34 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build PHP 7.2.34 + run: cd docker/ && docker build . --file Dockerfile --tag static-php --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.2.34 + - name: Push PHP 7.2.34 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-7.2.34-static-bin-x86_64.tar.gz" ./php && rm ./php + - name: Change Dockerfile to aarch64 + run: cd docker/ && sed -ie 's/alpine:latest/multiarch\/alpine:aarch64-edge/g' Dockerfile && docker run --rm --privileged multiarch/qemu-user-static:register --reset + - name: Build PHP 7.2.34 arm + run: cd docker/ && docker build . --file Dockerfile --tag static-php-arm --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.2.34 + - name: Push PHP 7.2.34 arm to dist + run: | + mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php-arm cp php-dist/bin/php /dist/ + cd dist && tar -zcvf "php-7.2.34-static-bin-aarch64.tar.gz" ./php && rm ./php + - name: Deploy to Zhamao Server + uses: easingthemes/ssh-deploy@main + env: + SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SERVER_SECRET_KEY }} + ARGS: "-rltgoDzvO" + SOURCE: "dist/" + REMOTE_HOST: ${{ secrets.DEPLOY_SERVER_HOST }} + REMOTE_PORT: ${{ secrets.DEPLOY_SERVER_PORT }} + REMOTE_USER: ${{ secrets.DEPLOY_SERVER_USER }} + TARGET: ${{ secrets.DEPLOY_SERVER_TARGET }} \ No newline at end of file diff --git a/.github/workflows/php-7.3.yml b/.github/workflows/php-7.3.yml new file mode 100644 index 00000000..c9444f5c --- /dev/null +++ b/.github/workflows/php-7.3.yml @@ -0,0 +1,40 @@ +name: Build PHP 7.3.30 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build PHP 7.3.30 + run: cd docker/ && docker build . --file Dockerfile --tag static-php --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.3.30 + - name: Push PHP 7.3.30 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-7.3.30-static-bin-x86_64.tar.gz" ./php && rm ./php + - name: Change Dockerfile to aarch64 + run: cd docker/ && sed -ie 's/alpine:latest/multiarch\/alpine:aarch64-edge/g' Dockerfile && docker run --rm --privileged multiarch/qemu-user-static:register --reset + - name: Build PHP 7.3.30 arm + run: cd docker/ && docker build . --file Dockerfile --tag static-php-arm --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.3.30 + - name: Push PHP 7.3.30 arm to dist + run: | + mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php-arm cp php-dist/bin/php /dist/ + cd dist && tar -zcvf "php-7.3.30-static-bin-aarch64.tar.gz" ./php && rm ./php + - name: Deploy to Zhamao Server + uses: easingthemes/ssh-deploy@main + env: + SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SERVER_SECRET_KEY }} + ARGS: "-rltgoDzvO" + SOURCE: "dist/" + REMOTE_HOST: ${{ secrets.DEPLOY_SERVER_HOST }} + REMOTE_PORT: ${{ secrets.DEPLOY_SERVER_PORT }} + REMOTE_USER: ${{ secrets.DEPLOY_SERVER_USER }} + TARGET: ${{ secrets.DEPLOY_SERVER_TARGET }} \ No newline at end of file diff --git a/.github/workflows/php-7.4.yml b/.github/workflows/php-7.4.yml new file mode 100644 index 00000000..549ad757 --- /dev/null +++ b/.github/workflows/php-7.4.yml @@ -0,0 +1,40 @@ +name: Build PHP 7.4.23 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build PHP 7.4.23 + run: cd docker/ && docker build . --file Dockerfile --tag static-php --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.4.23 + - name: Push PHP 7.4.23 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-7.4.23-static-bin-x86_64.tar.gz" ./php && rm ./php + - name: Change Dockerfile to aarch64 + run: cd docker/ && sed -ie 's/alpine:latest/multiarch\/alpine:aarch64-edge/g' Dockerfile && docker run --rm --privileged multiarch/qemu-user-static:register --reset + - name: Build PHP 7.4.23 arm + run: cd docker/ && docker build . --file Dockerfile --tag static-php-arm --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=7.4.23 + - name: Push PHP 7.4.23 arm to dist + run: | + mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php-arm cp php-dist/bin/php /dist/ + cd dist && tar -zcvf "php-7.4.23-static-bin-aarch64.tar.gz" ./php && rm ./php + - name: Deploy to Zhamao Server + uses: easingthemes/ssh-deploy@main + env: + SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SERVER_SECRET_KEY }} + ARGS: "-rltgoDzvO" + SOURCE: "dist/" + REMOTE_HOST: ${{ secrets.DEPLOY_SERVER_HOST }} + REMOTE_PORT: ${{ secrets.DEPLOY_SERVER_PORT }} + REMOTE_USER: ${{ secrets.DEPLOY_SERVER_USER }} + TARGET: ${{ secrets.DEPLOY_SERVER_TARGET }} \ No newline at end of file diff --git a/.github/workflows/php-8.0.yml b/.github/workflows/php-8.0.yml new file mode 100644 index 00000000..8ce678e3 --- /dev/null +++ b/.github/workflows/php-8.0.yml @@ -0,0 +1,40 @@ +name: Build PHP 8.0.10 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build PHP 8.0.10 + run: cd docker/ && docker build . --file Dockerfile --tag static-php --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=8.0.10 + - name: Push PHP 8.0.10 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-8.0.10-static-bin-x86_64.tar.gz" ./php && rm ./php + - name: Change Dockerfile to aarch64 + run: cd docker/ && sed -ie 's/alpine:latest/multiarch\/alpine:aarch64-edge/g' Dockerfile && docker run --rm --privileged multiarch/qemu-user-static:register --reset + - name: Build PHP 8.0.10 arm + run: cd docker/ && docker build . --file Dockerfile --tag static-php-arm --build-arg USE_BACKUP_ADDRESS=yes --build-arg COMPILE_PHP_VERSION=8.0.10 + - name: Push PHP 8.0.10 arm to dist + run: | + mkdir dist && docker run --rm -v $(pwd)/dist:/dist/ static-php-arm cp php-dist/bin/php /dist/ + cd dist && tar -zcvf "php-8.0.10-static-bin-aarch64.tar.gz" ./php && rm ./php + - name: Deploy to Zhamao Server + uses: easingthemes/ssh-deploy@main + env: + SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SERVER_SECRET_KEY }} + ARGS: "-rltgoDzvO" + SOURCE: "dist/" + REMOTE_HOST: ${{ secrets.DEPLOY_SERVER_HOST }} + REMOTE_PORT: ${{ secrets.DEPLOY_SERVER_PORT }} + REMOTE_USER: ${{ secrets.DEPLOY_SERVER_USER }} + TARGET: ${{ secrets.DEPLOY_SERVER_TARGET }} \ No newline at end of file diff --git a/action-deploy.sh b/action-deploy.sh deleted file mode 100644 index 55c2e06b..00000000 --- a/action-deploy.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -if [ -n "${GITHUB_TOKEN}" ]; then - print_info "setup with GITHUB_TOKEN" - remote_repo="https://x-access-token:${GITHUB_TOKEN}@${GITHUB_DOMAIN:-"github.com"}/${GITHUB_REPOSITORY}.git" -elif [ -n "${PERSONAL_TOKEN}" ]; then - print_info "setup with PERSONAL_TOKEN" - remote_repo="https://x-access-token:${PERSONAL_TOKEN}@${GITHUB_DOMAIN:-"github.com"}/${GITHUB_REPOSITORY}.git" -fi - -if ! git config --get user.name; then - git config --global user.name "${GITHUB_ACTOR}" -fi - -if ! git config --get user.email; then - git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-"github.com"}" -fi - -cd dist - -git init -b deploy - -git add . - -git commit -m "automatic deployment" - -git remote rm origin -git remote add origin "${remote_repo}" - -git push -u origin deploy --force diff --git a/docker/fast-compiler.sh b/docker/fast-compiler.sh index fc5b811c..84d2cf4f 100755 --- a/docker/fast-compiler.sh +++ b/docker/fast-compiler.sh @@ -2,7 +2,7 @@ # This script needs alpine linux system. -VER_PHP="7.4.21" +VER_PHP="7.4.23" USE_BACKUP="no" LINK_APK_REPO='mirrors.ustc.edu.cn'