release #14
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: release | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch for release' | |
required: true | |
default: 'main' | |
releaseType: | |
description: 'Type of release' | |
type: choice | |
required: true | |
default: 'patch' | |
options: | |
- major | |
- patch | |
- minor | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
fetch-depth: 0 | |
- name: Update changelog | |
id: update_changelog | |
uses: release-flow/keep-a-changelog-action@v2 | |
with: | |
command: bump | |
version: ${{ github.event.inputs.releaseType }} | |
tag-prefix: '' | |
keep-unreleased-section: true | |
- name: Display version number | |
run: | | |
echo "New release version: ${{ steps.update_changelog.outputs.version }}" | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.1 | |
extensions: json, dom, curl, libxml, mbstring | |
coverage: none | |
- name: Install Pint | |
run: composer global require laravel/pint | |
- name: Run Pint | |
run: pint src && pint tests | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: ${{ github.event.inputs.branch }} | |
commit_message: Prepare Release ${{ steps.update_changelog.outputs.version }} | |
- name: Create the tag | |
run: git tag ${{ steps.update_changelog.outputs.version }} | |
- name: Create the release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.update_changelog.outputs.version }} | |
body: ${{ steps.update_changelog.outputs.release-notes }} |