Fix Swoole package asset extension #55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux build | |
on: | |
pull_request: | |
push: | |
tags: | |
- '*' | |
jobs: | |
x86_64: | |
name: PHP ${{ matrix.php-version }} ${{ matrix.arch }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: ["8.1"] | |
arch: ["x86_64"] | |
max-parallel: 4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download PHP Cli | |
id: php_cli | |
run: | | |
gh run download 5471614657 -R hyperf/lwmbs -n cli_static_${{ matrix.php-version }}_musl_${{ matrix.arch }}_1245a03ecd8971e80be6c5a88a947035278229272751ab84b382eafd735e9a2c | |
ls -a | |
chmod 755 ./php | |
- name: Download Composer | |
id: composer | |
run: | | |
wget https://getcomposer.org/download/2.4.4/composer.phar | |
chmod 755 ./composer.phar | |
- name: Vendor Installation | |
id: vendor_installation | |
run: | | |
cd src | |
../php ../composer.phar install -o | |
- name: Create ~/.box folder | |
id: create_folder | |
run: | | |
cd ~ | |
rm -rf .box | |
mkdir .box | |
chmod 755 .box | |
- name: Build Box | |
id: box | |
continue-on-error: true | |
run: | | |
./php src/bin/hyperf.php config set github.access-token ${{ env.GITHUB_TOKEN }} | |
./php src/bin/hyperf.php config set-php-version ${{ matrix.php-version }} | |
./php src/bin/hyperf.php build-prepare | |
./php src/bin/hyperf.php build-self --no-dev | |
mv ~/.box/box ./box | |
./box version | |
rm -rf ~/.box | |
- name: Upload artifact for box | |
if: steps.box.outcome == 'success' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: box_${{ matrix.arch }} | |
path: | | |
box | |
- name: Fail if box build failed | |
if: steps.box.outcome != 'success' | |
run: | | |
false | |
steps: | |
- name: Get release | |
id: get_release | |
uses: bruceadams/get-release@v1.2.3 | |
continue-on-error: true | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Release Asset | |
if: steps.box.outcome == 'success' && steps.get_release.outputs.upload_url | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ./box | |
asset_name: box_${{ matrix.arch }}_linux | |
asset_content_type: application/x-sh | |
aarch64: | |
name: PHP ${{ matrix.php-version }} ${{ matrix.arch }} | |
runs-on: [self-hosted, linux, arm64] | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: [ "8.1" ] | |
arch: [ "aarch64" ] | |
max-parallel: 4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download PHP Cli | |
id: php_cli | |
run: | | |
gh run download 5471614657 -R hyperf/lwmbs -n cli_static_${{ matrix.php-version }}_musl_${{ matrix.arch }}_1245a03ecd8971e80be6c5a88a947035278229272751ab84b382eafd735e9a2c | |
ls -a | |
chmod 755 ./php | |
- name: Download Composer | |
id: composer | |
run: | | |
wget https://getcomposer.org/download/2.4.4/composer.phar | |
chmod 755 ./composer.phar | |
- name: Vendor Installation | |
id: vendor_installation | |
run: | | |
cd src | |
../php ../composer.phar install -o | |
- name: Create ~/.box folder | |
id: create_folder | |
run: | | |
cd ~ | |
rm -rf ~/.box | |
mkdir .box | |
chmod 755 .box | |
- name: Build Box | |
id: box | |
continue-on-error: true | |
run: | | |
./php src/bin/hyperf.php config set github.access-token ${{ env.GITHUB_TOKEN }} | |
./php src/bin/hyperf.php config set-php-version ${{ matrix.php-version }} | |
./php src/bin/hyperf.php build-prepare | |
./php src/bin/hyperf.php build-self --no-dev | |
mv ~/.box/box ./box | |
./box version | |
rm -rf ~/.box | |
- name: Upload artifact for box | |
if: steps.box.outcome == 'success' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: box_${{ matrix.arch }} | |
path: | | |
box | |
- name: Fail if box build failed | |
if: steps.box.outcome != 'success' | |
run: | | |
false | |
steps: | |
- name: Get release | |
id: get_release | |
uses: bruceadams/get-release@v1.2.3 | |
continue-on-error: true | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Release Asset | |
if: steps.box.outcome == 'success' && steps.get_release.outputs.upload_url | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ./box | |
asset_name: box_${{ matrix.arch }}_linux | |
asset_content_type: application/x-sh |