mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-04 04:02:30 +02:00
The committed PHPUnit runner lived at tools/.bin/phpunit.phar, away from the suite it runs. Move it next to the tests it drives — tests/phpunit.phar — and update every invocation to `php tests/phpunit.phar -c tests/phpunit.xml.dist`: - CI workflows (ci, build-release, build_pre-release) + the ci.yml header, - CLAUDE.md, CONTRIBUTING.md, tools/README.md, the qa-lead-reviewer agent, - docs/en (dev-workflow, updates_checklist, phpunit-phar, refactoring). docs/ru is generated from docs/en (make docs-translate) and is left for the next regeneration, per the docs workflow.
98 lines
2.7 KiB
YAML
98 lines
2.7 KiB
YAML
name: Build Pre-release Assets
|
|
|
|
on:
|
|
release:
|
|
types: [prereleased]
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag_name:
|
|
description: 'Pre-release tag (e.g., 1.2.3-beta.1)'
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
test:
|
|
name: Quality Gate
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Resolve tag name
|
|
id: tag
|
|
run: |
|
|
TAG="${{ github.event.inputs.tag_name || github.event.release.tag_name }}"
|
|
echo "name=${TAG}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ steps.tag.outputs.name }}
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.1'
|
|
coverage: none
|
|
|
|
- name: Run unit tests
|
|
run: php tests/phpunit.phar -c tests/phpunit.xml.dist
|
|
|
|
pre-release:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
tag_name: ${{ steps.tag.outputs.name }}
|
|
release_name: ${{ github.event.release.name || steps.tag.outputs.name }}
|
|
|
|
steps:
|
|
- name: Resolve tag name
|
|
id: tag
|
|
run: |
|
|
TAG="${{ github.event.inputs.tag_name || github.event.release.tag_name }}"
|
|
echo "name=${TAG}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
with:
|
|
ref: ${{ steps.tag.outputs.name }}
|
|
fetch-depth: 0
|
|
|
|
- name: Determine previous tag
|
|
id: prev_tag
|
|
run: |
|
|
CURRENT_TAG="${{ steps.tag.outputs.name }}"
|
|
PREV_TAG=$(git tag --sort=-v:refname | awk -v cur="$CURRENT_TAG" 'found { print; exit } $0 == cur { found=1 }')
|
|
if [ -z "$PREV_TAG" ]; then
|
|
echo "No previous tag found — update archives will be skipped"
|
|
echo "found=false" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "Previous tag: ${PREV_TAG}"
|
|
echo "tag=${PREV_TAG}" >> "$GITHUB_OUTPUT"
|
|
echo "found=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Clean dist directory
|
|
run: make new
|
|
|
|
- name: Build LB archive
|
|
run: make lb${{ steps.prev_tag.outputs.found == 'true' && format(' LAST_TAG="{0}"', steps.prev_tag.outputs.tag) || '' }}
|
|
|
|
- name: Build MAIN archive
|
|
run: make main${{ steps.prev_tag.outputs.found == 'true' && format(' LAST_TAG="{0}"', steps.prev_tag.outputs.tag) || '' }}
|
|
|
|
- name: Upload assets to pre-release
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
tag_name: ${{ steps.tag.outputs.name }}
|
|
files: dist/*
|
|
|
|
notify:
|
|
needs: pre-release
|
|
uses: ./.github/workflows/release-notifier.yml
|
|
with:
|
|
tag_name: ${{ needs.pre-release.outputs.tag_name }}
|
|
release_name: ${{ needs.pre-release.outputs.release_name }}
|
|
is_prerelease: true
|
|
secrets: inherit
|