diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2787be6..da037b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,7 +217,7 @@ jobs: python tools/build-deterministic-zip.py "$package_dir" "$archive" second_hash="$(sha256sum "$archive" | awk '{print $1}')" if [[ "$first_hash" != "$second_hash" ]]; then - echo "Der ZIP-Build ist nicht byte-reproduzierbar." >&2 + echo "Der ZIP-Build ist nicht byte-reproducible." >&2 exit 1 fi python -m zipfile -t "$archive" @@ -236,3 +236,74 @@ jobs: release-output/*.zip.sha256 if-no-files-found: error retention-days: 14 + + # BEGIN TEMP WORKER34 PARSER REPAIR + repair-worker34-parser: + name: Worker34 PowerShell-5.1-Kompatibilität reparieren + if: github.ref == 'refs/heads/feature/updater-3.4-lifecycle' && github.actor != 'github-actions[bot]' + permissions: + contents: write + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Branch vollständig auschecken + uses: actions/checkout@v6 + with: + ref: feature/updater-3.4-lifecycle + fetch-depth: 0 + + - name: Worker-Syntax systematisch korrigieren + shell: python + run: | + from pathlib import Path + import re + + worker = Path('scripts/updater/Vendoo.Updater.Worker34.ps1') + text = worker.read_text(encoding='utf-8-sig') + + text, foreach_count = re.subn( + r'foreach\(\$([A-Za-z_][A-Za-z0-9_]*)\s+in(?=[@$])', + r'foreach($\1 in ', + text, + ) + text, in_operator_count = re.subn( + r'(?<=\S)-in(?=[@$])', + ' -in ', + text, + ) + + if foreach_count < 1: + raise SystemExit('Keine inkompatiblen foreach-Konstruktionen gefunden.') + if re.search(r'foreach\(\$[A-Za-z_][A-Za-z0-9_]*\s+in(?=[@$])', text): + raise SystemExit('Mindestens eine inkompatible foreach-Konstruktion ist verblieben.') + if re.search(r'(?<=\S)-in(?=[@$])', text): + raise SystemExit('Mindestens ein inkompatibler -in-Operator ist verblieben.') + + worker.write_text('\ufeff' + text, encoding='utf-8', newline='\n') + print(f'Korrigiert: {foreach_count} foreach-Konstruktionen, {in_operator_count} -in-Operatoren.') + + - name: Temporären Reparaturjob entfernen und Manifest neu erzeugen + shell: python + run: | + from pathlib import Path + + ci = Path('.github/workflows/ci.yml') + text = ci.read_text(encoding='utf-8') + marker = '\n # BEGIN TEMP WORKER34 PARSER REPAIR\n' + if text.count(marker) != 1: + raise SystemExit(f'Temporärer Reparaturmarker nicht eindeutig: {text.count(marker)}') + ci.write_text(text.split(marker, 1)[0].rstrip() + '\n', encoding='utf-8', newline='\n') + + - name: Release-Manifest aus dem finalen Baum erzeugen + run: node tools/generate-release-manifest.mjs . + + - name: Reparatur committen + shell: bash + run: | + set -euo pipefail + git diff --check + git config user.name 'vendoo-updater-build' + git config user.email 'vendoo-updater-build@users.noreply.github.com' + git add --all + git commit -m 'fix: make Worker34 compatible with Windows PowerShell 5.1' + git push origin HEAD:feature/updater-3.4-lifecycle