Generate #44994
This file contains 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: Generate | |
on: | |
schedule: | |
- cron: '49 * * * *' | |
jobs: | |
supported-versions-matrix: | |
name: Supported Versions Matrix | |
runs-on: ubuntu-latest | |
outputs: | |
lowest: ${{ steps.supported-versions-matrix.outputs.lowest }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: supported-versions-matrix | |
uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 | |
with: | |
upcomingReleases: true | |
generate: | |
name: Generate | |
needs: | |
- supported-versions-matrix | |
runs-on: ubuntu-latest | |
container: | |
image: wyrihaximusnet/php:${{ needs.supported-versions-matrix.outputs.lowest }}-zts-alpine-dev-root | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: git config --global --add safe.directory $GITHUB_WORKSPACE # Do this ourself because `actions/checkout@v4 doesn't succeed in doing this | |
- name: Install Dependencies | |
run: composer install --ansi --no-progress --no-interaction --prefer-dist | |
- name: Generate new version file | |
id: generate | |
run: php tools/generate.php | |
- name: Test | |
run: php tests/test.php | |
- name: 'Get Previous tag' | |
id: previoustag | |
uses: "WyriHaximus/github-action-get-previous-tag@master" | |
env: | |
GITHUB_TOKEN: "${{ secrets.AUTH_TOKEN }}" | |
- name: 'Get files changed since previous tag' | |
id: fileschangedsinceprevioustag | |
uses: "WyriHaximus/github-action-files-in-commit@master" | |
with: | |
baseSha: ${{ steps.previoustag.outputs.tag }} | |
headSha: HEAD | |
env: | |
GITHUB_TOKEN: "${{ secrets.AUTH_TOKEN }}" | |
- name: 'Get next minor version' | |
id: semvers | |
if: steps.fileschangedsinceprevioustag.outputs.files == '' | |
uses: "WyriHaximus/github-action-next-semvers@master" | |
with: | |
version: ${{ steps.previoustag.outputs.tag }} | |
- name: 'Create new milestone' | |
id: createmilestone | |
if: steps.fileschangedsinceprevioustag.outputs.files == '' | |
uses: "WyriHaximus/github-action-create-milestone@master" | |
with: | |
title: ${{ steps.semvers.outputs.patch }} | |
description: ${{ env.PULL_REQUEST_BODY }} | |
env: | |
GITHUB_TOKEN: "${{ secrets.AUTH_TOKEN }}" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.AUTH_TOKEN }} | |
labels: | | |
Automated PR | |
New Version | |
automerge | |
title: "[New Version] Update versions file to PHP ${{ steps.generate.outputs.actual }}" | |
body: "With the release of PHP ${{ steps.generate.outputs.actual }} this packages needs updating. So this PR will bump current to ${{ steps.generate.outputs.current }} and future to ${{ steps.generate.outputs.future }}." | |
milestone: ${{ steps.createmilestone.outputs.number }} |