Files
XC_VM/.github/workflows/build-release.yml
T
Divarion-D 8d39f90902 chore(tools): remove php_syntax_check.sh — covered by PHPStan/CS/PHPUnit
`php -l` syntax checking is redundant with the real linters/validators (PHPStan
  parses the code, PHP-CS-Fixer and the PHPUnit bootstrap also fail on parse
  errors). Remove the script and every reference to it:

  - Makefile: drop the `syntax_check` target and its .PHONY entry.
  - CI (ci.yml): drop the dedicated `lint` (PHP Syntax Check) job.
  - Release workflows (build-release, build_pre-release): drop the "Check syntax"
    step from the Quality Gate (PHPUnit remains).
  - CONTRIBUTING.md: replace the syntax-check pre-commit guidance with the real
    checks (make dev-tools / phpstan / cs / gates / phpunit).
  - updates_checklist (en/ru): replace `make syntax_check` with the quality-check
    suite and drop the stale "Security scan" snippet that referenced the removed
    script and a non-existent tools/run_scan.sh (Semgrep runs automatically in CI).
2026-06-26 19:00:10 +03:00

99 lines
2.8 KiB
YAML

name: Build Release Assets
on:
release:
types: [released]
workflow_dispatch:
inputs:
tag_name:
description: 'Release tag (e.g., 1.2.3)'
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 tools/.bin/phpunit.phar -c tests/phpunit.xml.dist
build:
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
lfs: true
- 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 release
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.tag.outputs.name }}
files: dist/*
notify:
needs: build
uses: ./.github/workflows/release-notifier.yml
with:
tag_name: ${{ needs.build.outputs.tag_name }}
release_name: ${{ needs.build.outputs.release_name }}
is_prerelease: false
secrets: inherit