Skip to content

ビルド失敗時に GitHub Actions がエラーで止まるようにする#1334

Open
m-tmatma wants to merge 5 commits into
TeraTermProject:mainfrom
m-tmatma:fix/issue-1092-release-bat-errorlevel
Open

ビルド失敗時に GitHub Actions がエラーで止まるようにする#1334
m-tmatma wants to merge 5 commits into
TeraTermProject:mainfrom
m-tmatma:fix/issue-1092-release-bat-errorlevel

Conversation

@m-tmatma

@m-tmatma m-tmatma commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

概要

issue #1092 への対応。

installer/release.bat においてサブルーチンの呼び出し後にエラーチェックが行われていなかったため、ビルドが失敗しても GitHub Actions が正常終了してしまう問題を修正する。

変更内容

installer/release.bat

  • option 1〜6, 11〜14 の各 call の直後に if errorlevel 1 exit /b 1 を追加
    • サブルーチン(:download_libs, :build_libs, :build_teraterm, :build_teraterm_1, :build_teraterm_2)が失敗した場合にスクリプトを即座に終了するようにした
  • :build_libs サブルーチンにエラー伝播を追加
    • buildall.bat が失敗した場合に exit /b 1 を返すようにした(これまでは常に exit /b 0 を返していた)

installer/create_package.bat

  • 各コマンド(cmake -E copy_directory, %INNO_SETUP%, cmake -E tar, cmake -E sha256sum, cmake -E sha512sum)の直後にエラーチェックを追加
  • pushd Output ブロック内でエラーが発生した場合は popd してから exit /b 1 するようにした
  • 末尾に exit /b 0 を追加(これまでは最後のコマンドの終了コードがそのまま返っていた)

テスト結果

テスト用ブランチ test/issue-1092-verify で以下を確認済み。

ケース 内容 結果 Actions
A build_common.batexit /b 1 を追加 → :build_teraterm_1 失敗 build_common job の Build step で停止 ✓ https://github.com/m-tmatma/teraterm/actions/runs/26940874899
B teraterm.cpp#error を追加 → コンパイルエラー build_arch job の Build step で停止 ✓ https://github.com/m-tmatma/teraterm/actions/runs/26942723878
C buildall.batexit /b 1 を追加 → :build_libs 失敗 build_arch job の Build step で停止 ✓ https://github.com/m-tmatma/teraterm/actions/runs/26943120698
D teraterm.iss#error を追加 → create_package.bat 失敗 Build step で停止 ✓ https://github.com/m-tmatma/teraterm/actions/runs/26996806518

m-tmatma and others added 2 commits June 4, 2026 17:33
release.bat の option 1〜6, 11〜14 において、各 call の後に
if errorlevel 1 exit /b 1 を追加し、サブルーチンがエラーを返した
場合にスクリプトを即座に終了するようにした。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
buildall.bat が失敗した場合に exit /b 1 で返すようにした。
これまでは常に exit /b 0 を返していたため、libs のビルド失敗が
上位スクリプトに伝播しなかった。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
m-tmatma added a commit to m-tmatma/teraterm that referenced this pull request Jun 5, 2026
m-tmatma and others added 2 commits June 5, 2026 14:21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@m-tmatma m-tmatma closed this Jun 5, 2026
@m-tmatma m-tmatma reopened this Jun 5, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant