Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
branches:
- main

# Осмысленное имя ранa в Actions
run-name: >-
Release: ${{ github.event.pull_request.head.ref }} →
${{ github.event.pull_request.base.ref }}
(${{ github.event.pull_request.commits }} commits)

jobs:
release:
if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'stage'
Expand Down Expand Up @@ -44,18 +50,63 @@ jobs:
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "New version: $NEW_VERSION"

- name: Generate changelog from commits
id: changelog
run: |
LATEST_TAG="${{ steps.get_latest_tag.outputs.latest_tag }}"

if [ "$LATEST_TAG" = "v0.0.0" ]; then
# Первый релиз: берём все коммиты
RANGE=""
else
RANGE="$LATEST_TAG..HEAD"
fi

echo "Generating changelog for range: ${RANGE:-all commits}"

REPO="$GITHUB_REPOSITORY"

# Список коммитов в Markdown:
# - Message (`short_sha`) ([view](https://github.com/owner/repo/commit/full_sha))
COMMITS=$(git log $RANGE \
--pretty=format:'- %s (`%h`) ([view](https://github.com/'"$REPO"'/commit/%H))')

if [ -z "$COMMITS" ]; then
COMMITS="- No commits since $LATEST_TAG (nothing to list)"
fi

{
echo "changelog<<EOF"
echo "$COMMITS"
echo "EOF"
} >> "$GITHUB_OUTPUT"

- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.calculate_version.outputs.new_version }}
name: Release ${{ steps.calculate_version.outputs.new_version }}

# Более осмысленное имя релиза
name: >-
${{ github.event.pull_request.head.ref }} →
${{ github.event.pull_request.base.ref }} –
${{ steps.calculate_version.outputs.new_version }}
(${{ github.event.pull_request.commits }} commits)

body: |
## Changes in this Release

Merged from stage to main via PR #${{ github.event.pull_request.number }}
Merged from `${{ github.event.pull_request.head.ref }}` to `${{ github.event.pull_request.base.ref }}`
via PR #${{ github.event.pull_request.number }}

**Pull Request:** ${{ github.event.pull_request.title }}

For detailed changes, see the [Pull Request](${{ github.event.pull_request.html_url }})

---

### Commits since ${{ steps.get_latest_tag.outputs.latest_tag }}
${{ steps.changelog.outputs.changelog }}

draft: false
prerelease: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ test_auth_prod.php
/.env.test
/examples/
/.composer/
ARCHITECTURE_ANALYSIS.md
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

> **REST API на основе Laravel для совместного управления задачами и командами с аутентификацией через Sanctum**

[![PHP Version](https://img.shields.io/badge/PHP-8.2%2B-777BB4?style=flat-square&logo=php)](https://www.php.net/)
[![Laravel](https://img.shields.io/badge/Laravel-11.x-FF2D20?style=flat-square&logo=laravel)](https://laravel.com)
[![License](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square)](LICENSE)
[![Tests CI](https://github.com/sni10/Tasks-Laravel-REST-API-examples/actions/workflows/tests.yml/badge.svg)](https://github.com/sni10/Tasks-Laravel-REST-API-examples/actions/workflows/tests.yml)
[![PHPUnit](https://img.shields.io/badge/Tests-PHPUnit-4F5B93?style=flat-square&logo=php)](https://phpunit.de/)
[![Coverage](https://img.shields.io/badge/Coverage-PHPUnit%20HTML-informational?style=flat-square)](#tests)
[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?style=flat-square&logo=docker)](https://www.docker.com/)
[![Release](https://img.shields.io/github/v/release/sni10/Tasks-Laravel-REST-API-examples?style=for-the-badge&logo=github&logoColor=white)](https://github.com/sni10/Tasks-Laravel-REST-API-examples/releases)
[![Release Workflow](https://img.shields.io/github/actions/workflow/status/sni10/Tasks-Laravel-REST-API-examples/release.yml?style=for-the-badge&logo=githubactions&logoColor=white&label=Release)](https://github.com/sni10/Tasks-Laravel-REST-API-examples/actions/workflows/release.yml)
[![Tests](https://img.shields.io/github/actions/workflow/status/sni10/Tasks-Laravel-REST-API-examples/tests.yml?style=for-the-badge&logo=githubactions&logoColor=white&label=Tests)](https://github.com/sni10/Tasks-Laravel-REST-API-examples/actions/workflows/tests.yml)
[![Coverage](https://img.shields.io/badge/Coverage-65%25-brightgreen?style=for-the-badge&logo=codecov&logoColor=white)](https://github.com/sni10/Tasks-Laravel-REST-API-examples/actions/workflows/tests.yml)
[![PHP](https://img.shields.io/badge/PHP-8.2%2B-777BB4?style=for-the-badge&logo=php&logoColor=white)](https://www.php.net/)
[![Laravel](https://img.shields.io/badge/Laravel-11.x-FF2D20?style=for-the-badge&logo=laravel&logoColor=white)](https://laravel.com)
[![Docker](https://img.shields.io/badge/Docker-Ready-2496ED?style=for-the-badge&logo=docker&logoColor=white)](https://www.docker.com/)
[![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](LICENSE)

## Environments

Expand All @@ -17,8 +18,8 @@
### Production environment
- Использует `docker-compose.yml` как базовую конфигурацию
- Настроено для боевого развёртывания с оптимизированными параметрами
- Переменные окружения: `APP_ENV=production`, `APP_DEBUG=false`
- База данных: `task_management_test`
- Переменные окружения: `APP_ENV=prod`, `APP_DEBUG=false`
- База данных: `task_management`

### Development / Testing environment
- Использует `docker-compose.yml` + `docker/config-envs/test/docker-compose.override.yml`
Expand Down