diff --git a/.github/workflows/linux_release.yaml b/.github/workflows/linux.yaml similarity index 92% rename from .github/workflows/linux_release.yaml rename to .github/workflows/linux.yaml index 34050fc..39ee401 100644 --- a/.github/workflows/linux_release.yaml +++ b/.github/workflows/linux.yaml @@ -1,6 +1,7 @@ name: Linux build on: + pull_request: push: tags: - '*' @@ -77,11 +78,13 @@ jobs: - 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' + if: steps.box.outcome == 'success' && steps.get_release.outputs.upload_url id: upload-release-asset uses: actions/upload-release-asset@v1 env: @@ -91,6 +94,7 @@ jobs: 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] @@ -160,11 +164,13 @@ jobs: - 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' + if: steps.box.outcome == 'success' && steps.get_release.outputs.upload_url id: upload-release-asset uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/linux_pr.yaml b/.github/workflows/linux_pr.yaml deleted file mode 100644 index 9e8282f..0000000 --- a/.github/workflows/linux_pr.yaml +++ /dev/null @@ -1,138 +0,0 @@ -name: Linux build - -on: - pull_request: - -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 3825999869 -R hyperf/lwmbs -n cli_static_${{ matrix.php-version }}_musl_${{ matrix.arch }}_ad4bf78451bf9894c4711694556132cc8f268ebf4a4607ba487984cdd338efad - 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 ~ - 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 - - - name: Upload artifact for box - if: steps.box.outcome == 'success' - uses: actions/upload-artifact@v3 - with: - name: box_${{ matrix.arch }}_linux - path: | - box - - - name: Fail if box build failed - if: steps.box.outcome != 'success' - run: | - false - steps: - 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 3825999869 -R hyperf/lwmbs -n cli_static_${{ matrix.php-version }}_musl_${{ matrix.arch }}_ad4bf78451bf9894c4711694556132cc8f268ebf4a4607ba487984cdd338efad - 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 }}_linux - path: | - box - - - name: Fail if box build failed - if: steps.box.outcome != 'success' - run: | - false - steps: \ No newline at end of file diff --git a/.github/workflows/macos_release.yaml b/.github/workflows/macos.yaml similarity index 91% rename from .github/workflows/macos_release.yaml rename to .github/workflows/macos.yaml index 087c13f..71db678 100644 --- a/.github/workflows/macos_release.yaml +++ b/.github/workflows/macos.yaml @@ -1,6 +1,7 @@ name: MacOS build on: + pull_request: push: tags: - '*' @@ -72,11 +73,13 @@ jobs: - name: Get release id: get_release uses: bruceadams/get-release@v1.2.3 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Release Asset - if: steps.box.outcome == 'success' + if: steps.box.outcome == 'success' && steps.get_release.outputs.upload_url id: upload-release-asset uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/macos_pr.yaml b/.github/workflows/macos_pr.yaml deleted file mode 100644 index 2275c2d..0000000 --- a/.github/workflows/macos_pr.yaml +++ /dev/null @@ -1,68 +0,0 @@ -name: MacOS build - -on: - pull_request: - -jobs: - macos: - name: PHP ${{ matrix.php-version }} ${{ matrix.arch }} - runs-on: macos-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 3826009291 -R hyperf/lwmbs -n cli_${{ matrix.php-version }}_${{ matrix.arch }}_ad4bf78451bf9894c4711694556132cc8f268ebf4a4607ba487984cdd338efad - chmod 755 ./php - - - name: Download Composer - id: composer - run: | - wget https://getcomposer.org/download/2.3.7/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 ~ - 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 - - - name: Upload artifact for box - if: steps.box.outcome == 'success' - uses: actions/upload-artifact@v3 - with: - name: box_${{ matrix.arch }}_macos - path: | - box - - - name: Fail if box build failed - if: steps.box.outcome != 'success' - run: | - false diff --git a/.github/workflows/windows_release.yaml b/.github/workflows/windows.yaml similarity index 91% rename from .github/workflows/windows_release.yaml rename to .github/workflows/windows.yaml index e99fa1e..56f38c2 100644 --- a/.github/workflows/windows_release.yaml +++ b/.github/workflows/windows.yaml @@ -1,6 +1,7 @@ name: Windows build on: + pull_request: push: tags: - '*' @@ -72,11 +73,13 @@ jobs: - 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' + if: steps.box.outcome == 'success' && steps.get_release.outputs.upload_url id: upload-release-asset uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/windows_pr.yaml b/.github/workflows/windows_pr.yaml deleted file mode 100644 index 993e1b6..0000000 --- a/.github/workflows/windows_pr.yaml +++ /dev/null @@ -1,68 +0,0 @@ -name: Windows build - -on: - pull_request: - -jobs: - x86_64: - name: PHP ${{ matrix.php-version }} ${{ matrix.arch }} - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - php-version: ["8.1"] - arch: ["x64"] - 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 3825884688 -R hyperf/lwmbs -n cli_${{ matrix.php-version }}_${{ matrix.arch }}_ad4bf78451bf9894c4711694556132cc8f268ebf4a4607ba487984cdd338efad - ls -File - - - name: Download Composer - id: composer - run: | - curl -o composer.phar https://getcomposer.org/download/2.3.7/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 ~ - mkdir .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.exe ./box.exe - ./box.exe version - - - name: Upload artifact for box - if: steps.box.outcome == 'success' - uses: actions/upload-artifact@v3 - with: - name: box_${{ matrix.arch }}_windows.exe - path: | - box.exe - - - name: Fail if box build failed - if: steps.box.outcome != 'success' - run: | - false - steps: \ No newline at end of file