Disable v2 workflows temporarily

This commit is contained in:
crazywhalecc
2026-04-13 11:17:55 +08:00
parent 165372d17b
commit f6f7b629e3
3 changed files with 248 additions and 246 deletions

View File

@@ -1,175 +1,175 @@
name: Build SPC Binary name: Build SPC Binary
on: on:
push: push:
branches: [ "main" ] branches: [ "main", "v3" ]
pull_request: pull_request:
branches: [ "main" ] branches: [ "main", "v3" ]
paths: paths:
- '.github/workflows/release-build.yml' - '.github/workflows/release-build.yml'
release: release:
types: types:
- published - published
workflow_dispatch: workflow_dispatch:
env: env:
PHP_VERSION: 8.4 PHP_VERSION: 8.4
MICRO_VERSION: 8.4.11 MICRO_VERSION: 8.4.11
jobs: jobs:
build-release-artifacts: build-release-artifacts:
name: "Build SPC Binary for ${{ matrix.operating-system.name }}" name: "Build SPC Binary for ${{ matrix.operating-system.name }}"
runs-on: ${{ matrix.operating-system.os }} runs-on: ${{ matrix.operating-system.os }}
strategy: strategy:
matrix: matrix:
operating-system: operating-system:
- name: "linux-x86_64" - name: "linux-x86_64"
os: "ubuntu-latest" os: "ubuntu-latest"
filename: "spc-linux-x86_64.tar.gz" filename: "spc-linux-x86_64.tar.gz"
- name: "macos-x86_64" - name: "macos-x86_64"
os: "macos-15-intel" os: "macos-15-intel"
filename: "spc-macos-x86_64.tar.gz" filename: "spc-macos-x86_64.tar.gz"
- name: "linux-aarch64" - name: "linux-aarch64"
os: "ubuntu-latest" os: "ubuntu-latest"
filename: "spc-linux-aarch64.tar.gz" filename: "spc-linux-aarch64.tar.gz"
- name: "macos-aarch64" - name: "macos-aarch64"
os: "macos-14" os: "macos-14"
filename: "spc-macos-aarch64.tar.gz" filename: "spc-macos-aarch64.tar.gz"
- name: "windows-x64" - name: "windows-x64"
os: "ubuntu-latest" os: "ubuntu-latest"
filename: "spc-windows-x64.exe" filename: "spc-windows-x64.exe"
steps: steps:
- name: "Checkout" - name: "Checkout"
uses: "actions/checkout@v4" uses: "actions/checkout@v4"
- if: inputs.debug == true - if: inputs.debug == true
run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV run: echo "SPC_BUILD_DEBUG=--debug" >> $GITHUB_ENV
- name: "Install PHP for official runners" - name: "Install PHP for official runners"
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
coverage: none coverage: none
tools: composer:v2 tools: composer:v2
php-version: "${{ env.PHP_VERSION }}" php-version: "${{ env.PHP_VERSION }}"
ini-values: memory_limit=-1 ini-values: memory_limit=-1
extensions: curl, openssl, mbstring extensions: curl, openssl, mbstring
- name: "Get Composer Cache Directory" - name: "Get Composer Cache Directory"
id: composer-cache id: composer-cache
run: | run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: "Cache Composer dependencies" - name: "Cache Composer dependencies"
uses: "actions/cache@v4" uses: "actions/cache@v4"
with: with:
path: "${{ steps.composer-cache.outputs.dir }}" path: "${{ steps.composer-cache.outputs.dir }}"
key: "php-${{ env.PHP_VERSION }}-locked-composer-${{ hashFiles('**/composer.lock') }}" key: "php-${{ env.PHP_VERSION }}-locked-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: | restore-keys: |
php-${{ env.PHP_VERSION }}-locked-composer php-${{ env.PHP_VERSION }}-locked-composer
- name: "Install Locked Dependencies" - name: "Install Locked Dependencies"
run: "composer install --no-interaction --no-progress" run: "composer install --no-interaction --no-progress"
- name: "Build PHAR File" - name: "Build PHAR File"
run: "composer build:phar" run: "composer build:phar"
- name: "Download Minimal Combination" - name: "Download Minimal Combination"
run: | run: |
if [ "${{ matrix.operating-system.name }}" = "windows-x64" ]; then if [ "${{ matrix.operating-system.name }}" = "windows-x64" ]; then
curl -fsSL https://dl.static-php.dev/static-php-cli/windows/spc-min/php-${{ env.MICRO_VERSION }}-micro-win.zip -o tmp.zip curl -fsSL https://dl.static-php.dev/static-php-cli/windows/spc-min/php-${{ env.MICRO_VERSION }}-micro-win.zip -o tmp.zip
unzip tmp.zip unzip tmp.zip
else else
curl -fsSL https://dl.static-php.dev/static-php-cli/minimal/php-${{ env.MICRO_VERSION }}-micro-${{ matrix.operating-system.name }}.tar.gz -o tmp.tgz curl -fsSL https://dl.static-php.dev/static-php-cli/minimal/php-${{ env.MICRO_VERSION }}-micro-${{ matrix.operating-system.name }}.tar.gz -o tmp.tgz
tar -zxvf tmp.tgz tar -zxvf tmp.tgz
fi fi
- name: "Generate Executable" - name: "Generate Executable"
run: | run: |
bin/spc micro:combine spc.phar -M micro.sfx -O spc -I "memory_limit=2G" bin/spc micro:combine spc.phar -M micro.sfx -O spc -I "memory_limit=2G"
if [ "${{ matrix.operating-system.name }}" = "windows-x64" ]; then if [ "${{ matrix.operating-system.name }}" = "windows-x64" ]; then
mv spc spc.exe mv spc spc.exe
else else
chmod +x spc chmod +x spc
fi fi
if [ "${{ matrix.operating-system.name }}" = "macos-aarch64" ] || [ "${{ matrix.operating-system.name }}" = "macos-x86_64" ]; then if [ "${{ matrix.operating-system.name }}" = "macos-aarch64" ] || [ "${{ matrix.operating-system.name }}" = "macos-x86_64" ]; then
sudo xattr -cr ./spc sudo xattr -cr ./spc
fi fi
- name: "Archive Executable and Validate Binary" - name: "Archive Executable and Validate Binary"
run: | run: |
if [ "${{ matrix.operating-system.name }}" != "windows-x64" ]; then if [ "${{ matrix.operating-system.name }}" != "windows-x64" ]; then
tar -czf ${{ matrix.operating-system.filename }} spc tar -czf ${{ matrix.operating-system.filename }} spc
# validate spc binary # validate spc binary
if [ "${{ matrix.operating-system.name }}" == "linux-x86_64" ]; then if [ "${{ matrix.operating-system.name }}" == "linux-x86_64" ]; then
./spc dev:extensions ./spc dev:extensions
fi fi
fi fi
- name: "Copy file" - name: "Copy file"
run: | run: |
if [ "${{ matrix.operating-system.name }}" != "windows-x64" ]; then if [ "${{ matrix.operating-system.name }}" != "windows-x64" ]; then
mkdir dist/ && cp ${{ matrix.operating-system.filename }} dist/ && cp spc dist/spc-${{ matrix.operating-system.name }} mkdir dist/ && cp ${{ matrix.operating-system.filename }} dist/ && cp spc dist/spc-${{ matrix.operating-system.name }}
else else
mkdir dist/ && cp spc.exe dist/${{ matrix.operating-system.filename }} mkdir dist/ && cp spc.exe dist/${{ matrix.operating-system.filename }}
echo "SUFFIX=.exe" >> $GITHUB_ENV echo "SUFFIX=.exe" >> $GITHUB_ENV
fi fi
- name: "Upload Binaries to Release" - name: "Upload Binaries to Release"
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
if: ${{startsWith(github.ref, 'refs/tags/') }} if: ${{startsWith(github.ref, 'refs/tags/') }}
with: with:
files: dist/${{ matrix.operating-system.filename }} files: dist/${{ matrix.operating-system.filename }}
- name: "Deploy to self-hosted OSS" - name: "Deploy to self-hosted OSS"
# only run this step if the repository is static-php-cli and the branch is main # only run this step if the repository is static-php-cli and the branch is main
if: github.repository == 'crazywhalecc/static-php-cli' && github.ref == 'refs/heads/main' if: github.repository == 'crazywhalecc/static-php-cli' && github.ref == 'refs/heads/main'
uses: static-php/upload-s3-action@v1.0.0 uses: static-php/upload-s3-action@v1.0.0
with: with:
aws_key_id: ${{ secrets.AWS_KEY_ID }} aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_bucket: ${{ secrets.AWS_BUCKET }} aws_bucket: ${{ secrets.AWS_BUCKET }}
source_dir: "dist/" source_dir: "dist/"
destination_dir: static-php-cli/spc-bin/nightly/ destination_dir: static-php-cli/spc-bin/nightly/
endpoint: ${{ secrets.AWS_ENDPOINT }} endpoint: ${{ secrets.AWS_ENDPOINT }}
- name: "Upload Artifact" - name: "Upload Artifact"
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
path: spc${{ env.SUFFIX }} path: spc${{ env.SUFFIX }}
name: spc-${{ matrix.operating-system.name }}${{ env.SUFFIX }} name: spc-${{ matrix.operating-system.name }}${{ env.SUFFIX }}
test-spc: test-spc:
name: "Test SPC Binary for ${{ matrix.operating-system.name }}" name: "Test SPC Binary for ${{ matrix.operating-system.name }}"
runs-on: ${{ matrix.operating-system.os }} runs-on: ${{ matrix.operating-system.os }}
needs: [build-release-artifacts] needs: [build-release-artifacts]
strategy: strategy:
matrix: matrix:
operating-system: operating-system:
- name: "linux-x86_64" - name: "linux-x86_64"
os: "ubuntu-latest" os: "ubuntu-latest"
- name: "macos-x86_64" - name: "macos-x86_64"
os: "macos-15-intel" os: "macos-15-intel"
- name: "linux-aarch64" - name: "linux-aarch64"
os: "ubuntu-24.04-arm" os: "ubuntu-24.04-arm"
- name: "macos-aarch64" - name: "macos-aarch64"
os: "macos-15" os: "macos-15"
- name: "windows-x64" - name: "windows-x64"
os: "windows-latest" os: "windows-latest"
steps: steps:
- name: "Checkout" - name: "Checkout"
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: "Download Artifact" - name: "Download Artifact"
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
env: env:
SUFFIX: ${{ matrix.operating-system.name == 'windows-x64' && '.exe' || '' }} SUFFIX: ${{ matrix.operating-system.name == 'windows-x64' && '.exe' || '' }}
with: with:
name: spc-${{ matrix.operating-system.name }}${{ env.SUFFIX }} name: spc-${{ matrix.operating-system.name }}${{ env.SUFFIX }}
- name: "Chmod" - name: "Chmod"
if: matrix.operating-system.name != 'windows-x64' if: matrix.operating-system.name != 'windows-x64'
run: chmod +x spc run: chmod +x spc
- name: "Run SPC Tests" - name: "Run SPC Tests"
env: env:
SUFFIX: ${{ matrix.operating-system.name == 'windows-x64' && '.exe' || '' }} SUFFIX: ${{ matrix.operating-system.name == 'windows-x64' && '.exe' || '' }}
run: ./spc${{ env.SUFFIX }} dev:extensions run: ./spc${{ env.SUFFIX }} dev:extensions

View File

@@ -106,6 +106,7 @@ jobs:
run: SPC_LIBC=glibc vendor/bin/phpunit tests/ --no-coverage run: SPC_LIBC=glibc vendor/bin/phpunit tests/ --no-coverage
define-matrix: define-matrix:
if: false # TODO: enable when refactoring workflows
name: "Define Matrix" name: "Define Matrix"
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
@@ -131,6 +132,7 @@ jobs:
build: build:
if: false
name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})" name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
needs: [define-matrix, php-cs-fixer, phpstan, phpunit] needs: [define-matrix, php-cs-fixer, phpstan, phpunit]

View File

@@ -1,71 +1,71 @@
name: Docs Auto Deploy name: Docs Auto Deploy
on: on:
push: push:
branches: branches:
- main - v3
paths: paths:
- 'config/**.json' - 'config/**.yml'
- 'docs/**' - 'docs/**'
- 'package.json' - 'package.json'
- 'yarn.lock' - 'yarn.lock'
- '.github/workflows/vitepress-deploy.yml' - '.github/workflows/vitepress-deploy.yml'
jobs: jobs:
build: build:
name: Deploy docs name: Deploy docs
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'crazywhalecc/static-php-cli' if: github.repository == 'crazywhalecc/static-php-cli'
steps: steps:
- name: Checkout master - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
cache: yarn cache: yarn
- run: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile
- name: "Copy Config Files" - name: "Copy Config Files"
run: | run: |
mkdir -p docs/.vitepress/config mkdir -p docs/.vitepress/config
cp -r config/* docs/.vitepress/config/ cp -r config/* docs/.vitepress/config/
- name: "Install PHP for official runners" - name: "Install PHP for official runners"
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
coverage: none coverage: none
tools: composer:v2 tools: composer:v2
php-version: 8.4 php-version: 8.4
ini-values: memory_limit=-1 ini-values: memory_limit=-1
extensions: curl, openssl, mbstring extensions: curl, openssl, mbstring
- name: "Get Composer Cache Directory" - name: "Get Composer Cache Directory"
id: composer-cache id: composer-cache
run: | run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: "Cache Composer dependencies" - name: "Cache Composer dependencies"
uses: "actions/cache@v4" uses: "actions/cache@v4"
with: with:
path: "${{ steps.composer-cache.outputs.dir }}" path: "${{ steps.composer-cache.outputs.dir }}"
key: "php-8.2-locked-composer-${{ hashFiles('**/composer.lock') }}" key: "php-8.2-locked-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: | restore-keys: |
php-8.2-locked-composer php-8.2-locked-composer
- name: "Install Locked Dependencies" - name: "Install Locked Dependencies"
run: "composer install --no-interaction --no-progress" run: "composer install --no-interaction --no-progress"
- name: "Generate Extension Support List" - name: "Generate Extension Support List"
run: | run: |
bin/spc dev:gen-ext-docs > docs/extensions.md bin/spc dev:gen-ext-docs > docs/extensions.md
bin/spc dev:gen-ext-dep-docs > docs/deps-map-ext.md bin/spc dev:gen-ext-dep-docs > docs/deps-map-ext.md
bin/spc dev:gen-lib-dep-docs > docs/deps-map-lib.md bin/spc dev:gen-lib-dep-docs > docs/deps-map-lib.md
- name: Build - name: Build
run: yarn docs:build run: yarn docs:build
- name: Deploy to GitHub Pages - name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist publish_dir: docs/.vitepress/dist