|
| 1 | +name: phpMyFAQ Nightly 4.1 Build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: '0 2 * * *' |
| 7 | + |
| 8 | +jobs: |
| 9 | + run: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + operating-system: ['ubuntu-latest'] |
| 15 | + php-versions: ['8.3'] |
| 16 | + name: phpMyFAQ Nightly 4.1 Build |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout |
| 20 | + uses: actions/checkout@v6 |
| 21 | + with: |
| 22 | + ref: 'main' #'4.1' |
| 23 | + |
| 24 | + - name: Get current date |
| 25 | + id: date |
| 26 | + run: | |
| 27 | + echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV |
| 28 | +
|
| 29 | + - name: Get Release name |
| 30 | + run: | |
| 31 | + echo "release_name=nightly-${{ env.date }}" >> $GITHUB_ENV |
| 32 | +
|
| 33 | + - name: Bump version and push tag |
| 34 | + id: tag_version |
| 35 | + uses: mathieudutour/[email protected] |
| 36 | + with: |
| 37 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + tag_prefix: 4.1- |
| 39 | + custom_tag: ${{ env.release_name }} |
| 40 | + |
| 41 | + - name: Setup PHP, with composer and extensions |
| 42 | + uses: shivammathur/setup-php@v2 |
| 43 | + with: |
| 44 | + php-version: ${{ matrix.php-versions }} |
| 45 | + extensions: mbstring, curl, fileinfo, filter, gd, json, zip, xml, sqlite3, xdebug, pcov |
| 46 | + coverage: xdebug |
| 47 | + |
| 48 | + - name: Get composer cache directory |
| 49 | + id: composer-cache |
| 50 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 51 | + |
| 52 | + - name: Cache composer dependencies |
| 53 | + uses: actions/cache@v5 |
| 54 | + with: |
| 55 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 56 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
| 57 | + restore-keys: ${{ runner.os }}-composer- |
| 58 | + |
| 59 | + - name: Install PHP dependencies |
| 60 | + run: composer install --no-progress --prefer-dist --no-dev |
| 61 | + |
| 62 | + - name: Set Node.js 24.x |
| 63 | + uses: actions/setup-node@v6 |
| 64 | + with: |
| 65 | + package-manager-cache: false |
| 66 | + node-version: 24.x |
| 67 | + |
| 68 | + - uses: pnpm/action-setup@v4 |
| 69 | + name: Install pnpm |
| 70 | + id: pnpm-install |
| 71 | + with: |
| 72 | + version: 8.15.5 |
| 73 | + run_install: false |
| 74 | + |
| 75 | + - name: Get pnpm store directory |
| 76 | + id: pnpm-cache |
| 77 | + shell: bash |
| 78 | + run: | |
| 79 | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT |
| 80 | +
|
| 81 | + - uses: actions/cache@v5 |
| 82 | + name: Setup pnpm cache |
| 83 | + with: |
| 84 | + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} |
| 85 | + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 86 | + restore-keys: | |
| 87 | + ${{ runner.os }}-pnpm-store- |
| 88 | +
|
| 89 | + - name: Install Node.JS dependencies |
| 90 | + run: pnpm install |
| 91 | + |
| 92 | + - name: Run "pnpm build" to build frontend production build |
| 93 | + run: pnpm build |
| 94 | + |
| 95 | + - name: Create release artifact |
| 96 | + |
| 97 | + with: |
| 98 | + args: zip -X -r phpMyFAQ-${{ env.release_name }}.zip phpmyfaq -x "phpmyfaq/src/libs/tecnickcom/tcpdf/fonts/*" |
| 99 | + |
| 100 | + - name: Update nightly release |
| 101 | + uses: softprops/action-gh-release@v2 |
| 102 | + with: |
| 103 | + prerelease: true |
| 104 | + generate_release_notes: false |
| 105 | + tag_name: ${{ steps.tag_version.outputs.new_tag }} |
| 106 | + files: phpMyFAQ-${{ env.release_name }}.zip |
0 commit comments