This repository was archived by the owner on Jan 28, 2026. It is now read-only.
build #138
This file contains hidden or 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: Build application | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag version' | |
| required: true | |
| repository_dispatch: | |
| types: | |
| - build | |
| permissions: write-all | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Get the version | |
| id: tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| GITHUB_REF=${{ github.event.inputs.tag }} | |
| echo "tag=${GITHUB_REF##*}" >> "$GITHUB_OUTPUT" | |
| fi | |
| if [ "${{ github.event_name }}" = "repository_dispatch" ]; then | |
| GITHUB_REF=${{ github.event.client_payload.tag }} | |
| echo "tag=${GITHUB_REF}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Checkout the code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.2 | |
| extensions: curl, mbstring, zip, iconv, json, dom, fileinfo, tokenizer | |
| ini-values: error_reporting=E_ALL | |
| coverage: none | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction --no-suggest | |
| - name: Create the PHAR file | |
| run: php ./paw app:build paw --build-version=${{ steps.tag.outputs.tag }} --ansi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: paw | |
| path: builds/paw | |
| retention-days: 1 | |
| checks: | |
| runs-on: ${{ matrix.os }}-latest | |
| needs: build | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: [ ubuntu, windows ] | |
| php: [ 8.2, 8.3, 8.4 ] | |
| name: ${{ matrix.os }} - php ${{ matrix.php }} | |
| steps: | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }}-latest | |
| extensions: curl, mbstring, zip, iconv, json, dom, fileinfo, tokenizer | |
| ini-values: error_reporting=E_ALL | |
| coverage: none | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: paw | |
| path: builds | |
| - name: Show version | |
| run: php builds/paw --version | |
| push: | |
| runs-on: ubuntu-latest | |
| needs: checks | |
| steps: | |
| - name: Checkout the code | |
| uses: actions/checkout@v4 | |
| - name: Remove old file | |
| run: rm -f builds/paw | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: paw | |
| path: builds | |
| - name: Git setup | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git config --global core.autocrlf false | |
| git config --global core.eol lf | |
| - name: Commit the PHAR file | |
| id: build | |
| run: | | |
| IS_DIRTY=1 | |
| TAG=${{ steps.tag.outputs.tag }} | |
| { git add ./builds/paw && git commit -a -m "🏗️ Build application ${TAG}"; } || IS_DIRTY=0 | |
| echo "is_dirty=${IS_DIRTY}" >> "$GITHUB_OUTPUT" | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| if: steps.build.outputs.is_dirty == 1 | |
| with: | |
| github_token: ${{ secrets.COMPOSER_TOKEN }} |