|
| 1 | +name: "[Windows] Build Phalcon" |
| 2 | + |
| 3 | +on: |
| 4 | + - push |
| 5 | + - pull_request |
| 6 | + |
| 7 | +env: |
| 8 | + # All versions should be declared here |
| 9 | + PHALCON_VERSION: '5.12.0' |
| 10 | + PHP_VERSION_LIST: '8.1, 8.2, 8.3, 8.4, 8.5' |
| 11 | + ARCH_LIST: 'x64, x86' |
| 12 | + TS_LIST: 'nts, ts' |
| 13 | + |
| 14 | +jobs: |
| 15 | + get-extension-matrix: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + name: "Generate Extension Matrix" |
| 18 | + outputs: |
| 19 | + matrix: ${{ steps.extension-matrix.outputs.matrix }} |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v6 |
| 23 | + - name: Get the extension matrix |
| 24 | + id: extension-matrix |
| 25 | + uses: php/php-windows-builder/extension-matrix@v1 |
| 26 | + with: |
| 27 | + extension-url: https://github.com/phalcon/cphalcon |
| 28 | + extension-ref: ${{ env.PHALCON_VERSION }} |
| 29 | + php-version-list: ${{ env.PHP_VERSION_LIST }} |
| 30 | + arch-list: ${{ env.ARCH_LIST }} |
| 31 | + ts-list: ${{ env.TS_LIST }} |
| 32 | + |
| 33 | + build: |
| 34 | + needs: get-extension-matrix |
| 35 | + runs-on: ${{ matrix.os }} |
| 36 | + name: "Build Phalcon (PHP ${{ matrix.php-version }}-${{ matrix.ts }}-${{ matrix.arch }})" |
| 37 | + strategy: |
| 38 | + matrix: ${{ fromJson(needs.get-extension-matrix.outputs.matrix) }} |
| 39 | + steps: |
| 40 | + - name: Checkout |
| 41 | + uses: actions/checkout@v6 |
| 42 | + |
| 43 | + - name: Generate build folder |
| 44 | + run: | |
| 45 | + cd build/ |
| 46 | + php gen-build.php |
| 47 | + cd ../ |
| 48 | + pwd |
| 49 | + cp -v build/phalcon/*.* . |
| 50 | +
|
| 51 | + - name: Build the extension |
| 52 | + uses: php/php-windows-builder/extension@v1 |
| 53 | + with: |
| 54 | + args: --enable-phalcon |
| 55 | + php-version: ${{ matrix.php-version }} |
| 56 | + arch: ${{ matrix.arch }} |
| 57 | + ts: ${{ matrix.ts }} |
| 58 | + |
| 59 | + |
| 60 | +# - name: Extract Phalcon Version |
| 61 | +# shell: powershell |
| 62 | +# run: | |
| 63 | +# chcp 65001 |
| 64 | +# $r = Select-String -Path build/phalcon/php_phalcon.h -Pattern 'PHP_PHALCON_VERSION\s+"(.*)"' |
| 65 | +# $s = $r.Matches[0].Groups[1] |
| 66 | +# echo "$s" |
| 67 | +# $PhalconVersion = 'PHALCON_VERSION=' + $s |
| 68 | +# echo $PhalconVersion >> $env:GITHUB_ENV |
| 69 | +# |
| 70 | +# - name: Setup PHP |
| 71 | +# id: setup-php |
| 72 | +# uses: php/setup-php-sdk@v0.11 |
| 73 | +# with: |
| 74 | +# version: ${{matrix.php}} |
| 75 | +# arch: ${{matrix.arch}} |
| 76 | +# ts: ${{matrix.ts}} |
| 77 | +# deps: zlib |
| 78 | +# |
| 79 | +# - name: Upload artifacts |
| 80 | +# uses: actions/upload-artifact@v4 |
| 81 | +# with: |
| 82 | +# name: ${{env.ARTIFACT_NAME}} |
| 83 | +# path: | |
| 84 | +# ${{env.ARTIFACT}} |
| 85 | +# LICENSE.txt |
0 commit comments