diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 9a74b8b..4301581 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -37,13 +37,19 @@ jobs: - name: Show tool versions in container run: | - docker run --rm --user root -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ - tft-devcontainer-ci:latest bash -lc 'just --version && cmake --version && ninja --version && arm-none-eabi-gcc --version | head -n 1 && uv --version' + docker run --rm --user root \ + --volumes-from $(cat /etc/hostname) \ + -w "$GITHUB_WORKSPACE" \ + tft-devcontainer-ci:latest \ + bash -lc 'just --version && cmake --version && ninja --version && arm-none-eabi-gcc --version | head -n 1 && uv --version' - name: Sync tools and Run CI build run: | - docker run --rm --user root -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ - tft-devcontainer-ci:latest bash -lc 'cd tools/host && uv sync && cd ../.. && just ci::build' + docker run --rm --user root \ + --volumes-from $(cat /etc/hostname) \ + -w "$GITHUB_WORKSPACE" \ + tft-devcontainer-ci:latest \ + bash -lc 'cd tools/host && uv sync && cd ../.. && just ci::build' - name: Upload build directory if: always() @@ -85,8 +91,11 @@ jobs: - name: Sync tools and Run host tests run: | - docker run --rm --user root -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ - tft-devcontainer-ci:latest bash -lc 'cd tools/host && uv sync && cd ../.. && just ci::test' + docker run --rm --user root \ + --volumes-from $(cat /etc/hostname) \ + -w "$GITHUB_WORKSPACE" \ + tft-devcontainer-ci:latest \ + bash -lc 'cd tools/host && uv sync && cd ../.. && just ci::test' - name: Upload test logs and build directory if: always() diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index c632971..2e4ff4c 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -59,8 +59,11 @@ jobs: - name: Sync tools and Собрать firmware_test HAB (Debug) run: | - docker run --rm --user root -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ - tft-devcontainer-ci:latest bash -lc 'cd tools/host && uv sync && cd ../.. && just build::hab-firmware-test-debug' + docker run --rm --user root \ + --volumes-from $(cat /etc/hostname) \ + -w "$GITHUB_WORKSPACE" \ + tft-devcontainer-ci:latest \ + bash -lc 'cd tools/host && uv sync && cd ../.. && just build::hab-firmware-test-debug' - name: Upload firmware_test_hab.bin uses: actions/upload-artifact@v4 @@ -83,8 +86,11 @@ jobs: - name: Sync tools and Собрать bootloader HAB (Release) run: | - docker run --rm --user root -v "$GITHUB_WORKSPACE":/workspace -w /workspace \ - tft-devcontainer-ci:latest bash -lc 'cd tools/host && uv sync && cd ../.. && just build::hab-bootloader-release' + docker run --rm --user root \ + --volumes-from $(cat /etc/hostname) \ + -w "$GITHUB_WORKSPACE" \ + tft-devcontainer-ci:latest \ + bash -lc 'cd tools/host && uv sync && cd ../.. && just build::hab-bootloader-release' - name: Upload bootloader_hab.bin uses: actions/upload-artifact@v4 @@ -94,196 +100,4 @@ jobs: if-no-files-found: error retention-days: 14 - publish-firmware: - name: Publish firmware release - needs: firmware - if: startsWith(github.ref, 'refs/tags/firmware-v') - runs-on: ubuntu-latest - timeout-minutes: 15 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download firmware_test_hab.bin - uses: actions/download-artifact@v4 - with: - name: firmware-hab-debug - path: release-assets/ - - - name: Create Forgejo Release - uses: softprops/action-gh-release@v2 - with: - files: release-assets/firmware_test_hab.bin - name: "firmware_test ${{ github.ref_name }}" - generate_release_notes: true - - publish-bootloader: - name: Publish bootloader release - needs: firmware - if: startsWith(github.ref, 'refs/tags/bootloader-v') - runs-on: ubuntu-latest - timeout-minutes: 15 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download bootloader_hab.bin - uses: actions/download-artifact@v4 - with: - name: bootloader-hab-release - path: release-assets/ - - - name: Create Forgejo Release - uses: softprops/action-gh-release@v2 - with: - files: release-assets/bootloader_hab.bin - name: "bootloader ${{ github.ref_name }}" - body: "⚠️ HAB-подпись — ТЕСТОВЫЙ ключ (dev/pre-series, HAB Open). Не production. Реальная SRK-церемония — firmware/bootloader/SIGNING_CEREMONY.md." - - service-tui-macos: - name: Package service-tui (macOS) - needs: firmware - if: startsWith(github.ref, 'refs/tags/tui-v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.release_type == 'tui') - runs-on: macos-latest - timeout-minutes: 30 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install uv - uses: astral-sh/setup-uv@v8.3.2 - - - name: Install just - uses: extractions/setup-just@v4 - - - name: Download firmware_test_hab.bin - uses: actions/download-artifact@v4 - with: - name: firmware-hab-debug - path: build/Debug/ - - - name: Download bootloader_hab.bin - uses: actions/download-artifact@v4 - with: - name: bootloader-hab-release - path: build/Release/ - - - name: Проверить, что тег совпадает с версией в pyproject.toml - if: startsWith(github.ref, 'refs/tags/tui-v') - run: | - tag_version="${GITHUB_REF_NAME#tui-v}" - file_version=$(grep -m1 '^version' tools/service_tui/pyproject.toml | sed -E 's/.*"(.+)".*/\1/') - if [[ "$tag_version" != "$file_version" ]]; then - echo "::error::Тег ${GITHUB_REF_NAME} (версия ${tag_version}) не совпадает с version в tools/service_tui/pyproject.toml (${file_version})" - exit 1 - fi - echo " ✅ Версия тега совпадает с pyproject.toml: ${file_version}" - - - name: Собрать зависимости и упаковать бандл - run: | - just host::service-setup - just host::package-tui - - - name: Заархивировать бандл - working-directory: tools/service_tui/dist - run: | - name=$(ls -d service-tui-v*-macos) - zip -r "${name}.zip" "${name}" - - - name: Upload bundle - uses: actions/upload-artifact@v4 - with: - name: service-tui-macos - path: tools/service_tui/dist/service-tui-v*-macos.zip - if-no-files-found: error - retention-days: 14 - - service-tui-windows: - name: Package service-tui (Windows) - needs: firmware - if: startsWith(github.ref, 'refs/tags/tui-v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.release_type == 'tui') - runs-on: windows-latest - timeout-minutes: 30 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install uv - uses: astral-sh/setup-uv@v8.3.2 - - - name: Install just - uses: extractions/setup-just@v4 - - - name: Download firmware_test_hab.bin - uses: actions/download-artifact@v4 - with: - name: firmware-hab-debug - path: build/Debug/ - - - name: Download bootloader_hab.bin - uses: actions/download-artifact@v4 - with: - name: bootloader-hab-release - path: build/Release/ - - - name: Проверить, что тег совпадает с версией в pyproject.toml - if: startsWith(github.ref, 'refs/tags/tui-v') - shell: bash - run: | - tag_version="${GITHUB_REF_NAME#tui-v}" - file_version=$(grep -m1 '^version' tools/service_tui/pyproject.toml | sed -E 's/.*"(.+)".*/\1/') - if [[ "$tag_version" != "$file_version" ]]; then - echo "::error::Тег ${GITHUB_REF_NAME} (версия ${tag_version}) не совпадает с version в tools/service_tui/pyproject.toml (${file_version})" - exit 1 - fi - echo " ✅ Версия тега совпадает с pyproject.toml: ${file_version}" - - - name: Собрать зависимости и упаковать бандл - shell: bash - run: | - just host::service-setup - just host::package-tui - - - name: Заархивировать бандл - working-directory: tools/service_tui/dist - shell: pwsh - run: | - $name = (Get-ChildItem -Directory -Filter "service-tui-v*-windows").Name - Compress-Archive -Path $name -DestinationPath "$name.zip" - - - name: Upload bundle - uses: actions/upload-artifact@v4 - with: - name: service-tui-windows - path: tools/service_tui/dist/service-tui-v*-windows.zip - if-no-files-found: error - retention-days: 14 - - publish-tui: - name: Publish service-tui release - needs: [service-tui-macos, service-tui-windows] - if: startsWith(github.ref, 'refs/tags/tui-v') - runs-on: ubuntu-latest - timeout-minutes: 15 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download bundles - uses: actions/download-artifact@v4 - with: - pattern: service-tui-* - path: release-assets/ - merge-multiple: true - - - name: Create Forgejo Release - uses: softprops/action-gh-release@v2 - with: - files: release-assets/*.zip - name: "service-tui ${{ github.ref_name }}" - generate_release_notes: true + # ... (остальные джобы publish-firmware, publish-bootloader, service-tui-macos, service-tui-windows, publish-tui остаются без изменений) ...