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
5 changes: 3 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: PHP Composer

on:
push:
branches: ["main"]
branches:
- main
- "[0-9]+.[0-9]+"
pull_request:
branches: ["main"]

permissions:
contents: read
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,32 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0
fetch-tags: true

- name: Get latest tag and compute next patch version
- name: Compute next patch version for the PR's release line
id: version
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
latest=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
if [[ ! "$HEAD_REF" =~ ^([0-9]+)\.([0-9]+)$ ]]; then
echo "PR head ref '$HEAD_REF' is not a release branch (expected '<major>.<minor>'); refusing to tag." >&2
exit 1
fi
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
latest=$(git tag --sort=-v:refname | grep -E "^v${major}\.${minor}\.[0-9]+$" | head -1)
if [ -z "$latest" ]; then
echo "next=v0.0.1" >> "$GITHUB_OUTPUT"
next="v${major}.${minor}.1"
else
major=$(echo "$latest" | cut -d. -f1)
minor=$(echo "$latest" | cut -d. -f2)
patch=$(echo "$latest" | cut -d. -f3)
next_patch=$((patch + 1))
echo "next=${major}.${minor}.${next_patch}" >> "$GITHUB_OUTPUT"
next="v${major}.${minor}.$((patch + 1))"
fi
echo "Latest tag: ${latest:-none}, next: $(cat "$GITHUB_OUTPUT" | grep next | cut -d= -f2)"
echo "next=$next" >> "$GITHUB_OUTPUT"
echo "Release line: ${major}.${minor}, latest tag: ${latest:-none}, next: $next"

- name: Create and push tag
run: |
Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
],
"require": {
"php": "^8.5",
"chamber-orchestra/view-bundle": "8.0.*",
"symfony/dependency-injection": "8.0.*",
"symfony/config": "8.0.*",
"symfony/framework-bundle": "8.0.*",
"symfony/runtime": "8.0.*",
"symfony/form": "8.0.*",
"symfony/validator": "8.0.*",
"symfony/translation": "8.0.*",
"symfony/clock": "8.0.*",
"chamber-orchestra/view-bundle": "8.1.*",
"symfony/dependency-injection": "8.1.*",
"symfony/config": "8.1.*",
"symfony/framework-bundle": "8.1.*",
"symfony/runtime": "8.1.*",
"symfony/form": "8.1.*",
"symfony/validator": "8.1.*",
"symfony/translation": "8.1.*",
"symfony/clock": "8.1.*",
"doctrine/orm": "3.6.*"
},
"require-dev": {
Expand Down Expand Up @@ -75,7 +75,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "8.0.*"
"require": "8.1.*"
}
},
"config": {
Expand Down
Loading