Skip to content

1.15.3

1.15.3 #109

Workflow file for this run

name: Publish the released PHAR
on:
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-22.04
name: Release PHAR
steps:
- name: Extract the tag version
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
GITHUB_REF=${{ github.event.inputs.tag }}
fi
echo "tag=${GITHUB_REF##*v}" >> "$GITHUB_OUTPUT"
- name: Checkout the code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: dom, curl, libxml, mbstring, zip
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
- name: Install the dependencies
run: composer install --prefer-dist --optimize-autoloader --ansi --no-interaction --no-progress --no-suggest --no-scripts
- name: Create the PHAR file.
run: ./ai-commit app:build ai-commit.phar --build-version=${{ steps.tag.outputs.tag }} -v
- name: Upload the PHAR artifact
uses: actions/upload-artifact@v4
with:
name: ai-commit.phar
path: builds/ai-commit.phar
- name: Upload the PHAR to release
# run: gh release upload v${{ steps.tag.outputs.tag }} builds/ai-commit.phar
run: gh release upload $(git tag --sort=-committerdate | head -n 1) builds/ai-commit.phar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cp ai-commit.phar to ai-commit
run: cp builds/ai-commit.phar builds/ai-commit
- name: Commit bump
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Bump to ${{ github.event.release.name }}
file_pattern: builds/ai-commit CHANGELOG.md