Merge remote-tracking branch 'origin/main' into ext/gettext

This commit is contained in:
crazywhalecc 2024-02-17 00:47:40 +08:00
commit f11b36ab3c
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
5 changed files with 607 additions and 393 deletions

View File

@ -15,14 +15,15 @@ jobs:
strategy: strategy:
matrix: matrix:
php-version: php-version:
- "8.1" - "8.2"
micro-version: micro-version:
- "8.1.26" - "8.2.16"
operating-system: operating-system:
- "linux-x86_64" - "linux-x86_64"
- "macos-x86_64" - "macos-x86_64"
- "linux-aarch64" - "linux-aarch64"
- "macos-aarch64" - "macos-aarch64"
- "windows-x64"
steps: steps:
- name: "Checkout" - name: "Checkout"
uses: "actions/checkout@v4" uses: "actions/checkout@v4"
@ -59,31 +60,51 @@ jobs:
- name: "Download minimal combination" - name: "Download minimal combination"
run: | run: |
curl https://dl.static-php.dev/static-php-cli/minimal/php-${{ matrix.micro-version }}-micro-${{ matrix.operating-system }}.tar.gz -o tmp.tgz if [ "${{ matrix.operating-system }}" = "windows-x64" ]; then
tar -zxvf tmp.tgz curl https://dl.static-php.dev/static-php-cli/windows/spc-min/php-${{ matrix.micro-version }}-micro-win.zip -o tmp.zip
unzip tmp.zip
else
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
fi
- name: "Generate Executable" - name: "Generate Executable"
run: | run: |
cat micro.sfx spc.phar > spc if [ "${{ matrix.operating-system }}" = "windows-x64" ]; then
chmod +x spc cat micro.sfx spc.phar > spc.exe
else
cat micro.sfx spc.phar > spc
chmod +x spc
fi
- name: "Archive Executable" - name: "Archive Executable"
run: | run: |
tar -czf spc-${{ matrix.operating-system }}.tar.gz spc if [ "${{ matrix.operating-system }}" != "windows-x64" ]; then
echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV tar -czf spc-${{ matrix.operating-system }}.tar.gz spc
echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV echo "filename=spc-${{ matrix.operating-system }}.tar.gz" >> $GITHUB_ENV
if [ "${{ matrix.operating-system }}" == "linux-x86_64" ]; then echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV
./spc dev:extensions if [ "${{ matrix.operating-system }}" == "linux-x86_64" ]; then
./spc dev:extensions
fi
else
echo "filename=spc-${{ matrix.operating-system }}.exe" >> $GITHUB_ENV
echo "OS=${{ matrix.operating-system }}" >> $GITHUB_ENV
fi fi
- name: "Copy file" - name: "Copy file"
run: "mkdir dist/ && cp ${{ env.filename }} dist/ && cp spc dist/spc-$OS" run: |
if [ "${{ matrix.operating-system }}" != "windows-x64" ]; then
mkdir dist/ && cp ${{ env.filename }} dist/ && cp spc dist/spc-$OS
else
mkdir dist/ && cp spc.exe dist/${{ env.filename }}
echo "SUFFIX=.exe" >> $GITHUB_ENV
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: ${{ env.filename }} files: dist/${{ env.filename }}
- name: "Deploy to Self-Hosted Server" - name: "Deploy to Self-Hosted Server"
if: github.repository == 'crazywhalecc/static-php-cli' if: github.repository == 'crazywhalecc/static-php-cli'
@ -100,5 +121,5 @@ jobs:
- name: "Upload Artifact" - name: "Upload Artifact"
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
path: spc path: spc${{ env.SUFFIX }}
name: spc-${{ matrix.operating-system }} name: spc-${{ matrix.operating-system }}${{ env.SUFFIX }}

View File

@ -14,6 +14,5 @@
"vendor/zhamao" "vendor/zhamao"
], ],
"git-commit-short": "git_commit_short", "git-commit-short": "git_commit_short",
"metadata": "ConsoleApplication::VERSION",
"output": "spc.phar" "output": "spc.phar"
} }

View File

@ -19,10 +19,10 @@
"captainhook/captainhook": "^5.10", "captainhook/captainhook": "^5.10",
"captainhook/plugin-composer": "^5.3", "captainhook/plugin-composer": "^5.3",
"friendsofphp/php-cs-fixer": "^3.25", "friendsofphp/php-cs-fixer": "^3.25",
"humbug/box": "^4.3", "humbug/box": "^4.5",
"nunomaduro/collision": "^7.8", "nunomaduro/collision": "^7.8",
"phpstan/phpstan": "^1.10", "phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.3" "phpunit/phpunit": "^10.3 || ^9"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

940
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ use Symfony\Component\Console\Command\ListCommand;
*/ */
final class ConsoleApplication extends Application final class ConsoleApplication extends Application
{ {
public const VERSION = '2.1.0-beta.2'; public const VERSION = '2.1.0-beta.3';
public function __construct() public function __construct()
{ {