name: Build the PHAR

on:
  push:
    branches: [ "main" ]

permissions:
  contents: read

jobs:
  phar:
    name: Create a PHAR and upload it as an artifact
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Build the PHAR
        uses: ./.github/actions/phar

      - name: Upload the PHAR
        uses: actions/upload-artifact@v3
        with:
          name: 'jolinotif'
          path: tools/phar/build/jolinotif.phar
          if-no-files-found: error
