|
| 1 | +name: Cache PHP |
| 2 | +on: |
| 3 | + - push |
| 4 | + - repository_dispatch |
| 5 | + - workflow_dispatch |
| 6 | +jobs: |
| 7 | + cache: |
| 8 | + container: ubuntu:${{ matrix.container }} |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + container: [20.04, 18.04, 16.04] |
| 14 | + php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] |
| 15 | + if: "!contains(github.event.head_commit.message, 'skip-build')" |
| 16 | + steps: |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v2 |
| 19 | + - name: Install requirements |
| 20 | + run: bash src/install-requirements.sh |
| 21 | + - name: Set up Homebrew |
| 22 | + env: |
| 23 | + HOMEBREW_FORCE_HOMEBREW_ON_LINUX: 1 |
| 24 | + uses: shivammathur/actions/setup-homebrew@shivammathur-patch-git-retry |
| 25 | + - name: Install zstd |
| 26 | + run: bash src/install-zstd.sh |
| 27 | + - name: Configure git |
| 28 | + run: bash src/configure-git.sh |
| 29 | + - name: Setup PHP |
| 30 | + env: |
| 31 | + PHP_VERSION: ${{ matrix.php-versions }} |
| 32 | + run: bash src/install-php.sh |
| 33 | + - name: Build package |
| 34 | + env: |
| 35 | + GITHUB_WORKSPACE: ${{ github.workspace }} |
| 36 | + PHP_VERSION: ${{ matrix.php-versions }} |
| 37 | + run: bash src/package.sh |
| 38 | + - name: Upload Artifact |
| 39 | + uses: actions/upload-artifact@v2 |
| 40 | + with: |
| 41 | + name: ${{ matrix.php-versions }} |
| 42 | + path: builds |
| 43 | + release: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + needs: cache |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + - run: mkdir builds |
| 49 | + - uses: actions/download-artifact@v2 |
| 50 | + with: |
| 51 | + path: builds |
| 52 | + - name: Setup Python |
| 53 | + uses: actions/setup-python@v2 |
| 54 | + with: |
| 55 | + python-version: 3.x |
| 56 | + - name: Install cloudsmith-cli |
| 57 | + run: pip install --upgrade cloudsmith-cli |
| 58 | + - name: Release |
| 59 | + run: bash src/release.sh |
| 60 | + env: |
| 61 | + CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} |
| 62 | + GITHUB_REPOSITORY: ${{ github.repository }} |
| 63 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 64 | + GITHUB_WORKSPACE: ${{ github.workspace }} |
0 commit comments