mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
update release-build (Build SPC Binary) workflow
This commit is contained in:
parent
269e95e0fe
commit
cb5e13e39a
73
.github/workflows/release-build.yml
vendored
73
.github/workflows/release-build.yml
vendored
@ -1,6 +1,8 @@
|
|||||||
name: Upload SPC Binary (Release)
|
name: Build SPC Binary
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main" ]
|
||||||
release:
|
release:
|
||||||
types:
|
types:
|
||||||
- published
|
- published
|
||||||
@ -8,10 +10,14 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-release-artifacts:
|
build-release-artifacts:
|
||||||
name: "Upload SPC Binary (Release)"
|
name: "Build SPC Binary"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
php-version:
|
||||||
|
- "8.1"
|
||||||
|
micro-version:
|
||||||
|
- "8.1.26"
|
||||||
operating-system:
|
operating-system:
|
||||||
- "linux-x86_64"
|
- "linux-x86_64"
|
||||||
- "macos-x86_64"
|
- "macos-x86_64"
|
||||||
@ -21,18 +27,57 @@ jobs:
|
|||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: "actions/checkout@v4"
|
uses: "actions/checkout@v4"
|
||||||
|
|
||||||
- name: Reuse static-php-cli-hosted artifacts
|
- if: inputs.debug == true
|
||||||
uses: dawidd6/action-download-artifact@v2
|
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: "Install PHP for official runners"
|
||||||
|
uses: "shivammathur/setup-php@v2"
|
||||||
with:
|
with:
|
||||||
repo: static-php/static-php-cli-hosted
|
coverage: none
|
||||||
branch: master
|
tools: composer:v2
|
||||||
workflow: build-spc-release.yml
|
php-version: "${{ matrix.php-version }}"
|
||||||
name: "spc-${{ matrix.operating-system }}"
|
ini-values: memory_limit=-1
|
||||||
|
|
||||||
|
- name: "Get Composer Cache Directory"
|
||||||
|
id: composer-cache
|
||||||
|
run: |
|
||||||
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: "Cache Composer dependencies"
|
||||||
|
uses: "actions/cache@v3"
|
||||||
|
with:
|
||||||
|
path: "${{ steps.composer-cache.outputs.dir }}"
|
||||||
|
key: "php-${{ matrix.php-version }}-locked-composer-${{ hashFiles('**/composer.lock') }}"
|
||||||
|
restore-keys: |
|
||||||
|
php-${{ matrix.php-version }}-locked-composer
|
||||||
|
|
||||||
|
- name: "Install Locked Dependencies"
|
||||||
|
run: "composer install --no-interaction --no-progress"
|
||||||
|
|
||||||
|
- name: "Build PHAR File"
|
||||||
|
run: "composer build:phar"
|
||||||
|
|
||||||
|
- name: "Download minimal combination"
|
||||||
|
run: |
|
||||||
|
curl https://dl.static-php.dev/static-php-cli/minimal/php-${{ matrix.micro-version }}-micro-${{ matrix.operating-system }}.tar.gz -o tmp.tgz
|
||||||
|
tar -zxvf tmp.tgz
|
||||||
|
|
||||||
|
- name: "Generate Executable"
|
||||||
|
run: |
|
||||||
|
cat micro.sfx spc.phar > spc
|
||||||
|
chmod +x spc
|
||||||
|
|
||||||
- name: "Archive Executable"
|
- name: "Archive Executable"
|
||||||
run: |
|
run: |
|
||||||
tar -czf spc-${{ matrix.operating-system }}.tar.gz spc
|
tar -czf spc-${{ matrix.operating-system }}.tar.gz spc
|
||||||
echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV
|
echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV
|
||||||
|
echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV
|
||||||
|
if [ "${{ matrix.operating-system }}" == "linux-x86_64" ]; then
|
||||||
|
./spc dev:extensions
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: "Copy file"
|
||||||
|
run: "mkdir dist/ && cp ${{ env.filename }} dist/ && cp spc dist/spc-$OS"
|
||||||
|
|
||||||
- name: upload binaries to release
|
- name: upload binaries to release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
@ -40,6 +85,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
files: ${{ env.filename }}
|
files: ${{ env.filename }}
|
||||||
|
|
||||||
|
- name: "Deploy to Self-Hosted Server"
|
||||||
|
if: secrets.DEPLOY_SERVER_HOST != ''
|
||||||
|
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_SPC_NIGHTLY }}
|
||||||
|
|
||||||
- name: "Upload Artifact"
|
- name: "Upload Artifact"
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user