Skip to content

ci: リリースPRマージ時の処理をタグ作成とGitHub Release公開だけにする - #324

Merged
stotic-dev merged 7 commits into
mainfrom
ci/simplify-release-merged
Sep 29, 2026
Merged

stotic-dev merged 7 commits into
mainfrom
ci/simplify-release-merged

Conversation

@stotic-dev

@stotic-dev stotic-dev commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

経緯

v1.0.0のリリースPRをマージしたとき、Release Merged ワークフローの Trigger Xcode Cloud Upload For AppStore build ステップが失敗した(run)。
XCODE_CLOUD_APPSTORE_WORKFLOW_ID シークレットが登録されておらず、scripts/trigger-xcode-cloud-build.sh に空のワークフローIDが渡ったのが原因。

リリースは別の手段で完了しており、PRマージ時に自動で行いたいのはタグの作成とGitHub Releaseの公開だけなので、ワークフローからそれ以外の処理を外す。

実装内容

  • release-merged.yml から次の2ステップを削除
    • Xcode Cloud「Upload For AppStore」の起動: 未登録のシークレットに依存していて、API呼び出し(ciBuildRuns の作成)も一度も動作確認できていない
    • sync-metadata.yml の起動: マージ時に自動で走らせる必要がないため。ワークフロー自体は残し、必要なときに workflow_dispatch で手動実行する
  • 他のワークフローを起動しなくなったので、permissions から actions: write を外した(最小権限)
  • 同じバージョンのGitHub Releaseがすでにあれば、削除してから作り直すようにした。タグは git tag -f / git push -f で上書きされるのに、Releaseは gh release create が既存のReleaseでエラーになり、同じバージョンで再実行できなかったため。削除に --cleanup-tag は付けない(直前にpushしたタグまで消えるため)
  • 呼び出し元がなくなった scripts/trigger-xcode-cloud-build.sh を削除
  • 「release-merged.ymlから起動される」前提で書かれていたコメントを直した(sync-metadata.yml / ci_post_xcodebuild.sh / Fastfile)
  • create-release-pr.yml が作るリリースPRの本文を、実際の動きに合わせて直した。以前は「マージするとメタデータ同期とXcode CloudのUpload For AppStoreが自動で走る」と書かれていた
    • Xcode Cloud「Upload For AppStore」の開始条件は、App Store Connect側で「すべてのタグ」から「release/ ブランチへの変更」に変える(リポジトリ外の設定変更)。これにより、マージ時のタグpushでは起動しなくなる
    • 本文は「PRへのpushでTestFlight配信とApp Storeへのアップロードが走り、マージではタグ作成とGitHub Release publishだけが走る」という説明にした
  • ADR-0016の方針を一部変えるため、ADR-0027を追加し、ADR-0016のステータス欄に廃止した範囲を追記した

確認内容

  • 次のリリースPRをマージしたとき、Release Merged がタグのpushとGitHub Releaseの公開まで成功する
  • App Store ConnectでUpload For AppStoreの開始条件が release/ ブランチへの変更になっている
  • 次のリリースPRへのpushでUpload For AppStoreが起動し、マージ時(タグpush)には起動しない
  • 同じバージョンで再実行したとき、既存のReleaseが作り直されて成功する
  • リポジトリ内に trigger-xcode-cloud-build.sh / XCODE_CLOUD_APPSTORE_WORKFLOW_ID への参照が残っていない(ADRの経緯説明を除く)

🤖 Generated with Claude Code

stotic-dev and others added 3 commits September 29, 2026 22:54
メタデータ同期の起動とXcode Cloud「Upload For AppStore」の起動を
release-merged.ymlから外す。sync-metadata.ymlは手動実行用に残す。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T14:08:20.861975Z 76d999b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d521e8fb16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

ASC_API_KEY_PATH="$KEY_PATH" ./scripts/trigger-xcode-cloud-build.sh "$XCODE_CLOUD_APPSTORE_WORKFLOW_ID" main
rm -f "$KEY_PATH"

- name: Create summary

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the release PR guidance after disabling automation

When a release PR is created through .github/workflows/create-release-pr.yml, its generated body still says that merging automatically runs metadata synchronization and the Xcode Cloud Upload For AppStore workflow (lines 98–100). This workflow now proceeds directly from publishing the GitHub Release to its summary, so an operator following the PR instructions can omit both newly manual steps and leave the App Store release incomplete. Update the generated PR body/checklist to describe the required manual steps and their order.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご指摘ありがとうございます。f0fd2616 で対応しました。create-release-pr.yml が生成するリリースPRの本文を「マージで自動実行されるのはタグ作成とGitHub Release publishだけ」に直し、マージ後に手動で行う手順(Sync Metadata → Xcode CloudのUpload For AppStore)を、順番付きのチェックリストとして追加しました。

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

追加対応: 3be03e2 でマージ後の手動手順を削除しました。Xcode Cloudの「Upload For AppStore」の開始条件を release/ ブランチへの変更に変えるため、マージ後に手動で実行する処理はなくなります(メタデータ同期も不要)。リリースPRの本文は、PRへのpushでTestFlight配信とApp Storeへのアップロードが走り、マージではタグ作成とGitHub Release publishだけが走る、という説明にしました。

stotic-dev and others added 3 commits September 29, 2026 22:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
マージ後の手動手順は不要になったので削除する。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stotic-dev
stotic-dev merged commit 8783112 into main Sep 29, 2026
2 checks passed
@stotic-dev
stotic-dev deleted the ci/simplify-release-merged branch September 29, 2026 14:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76d999b421

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +50 to +52
if gh release view "$VERSION" > /dev/null 2>&1; then
gh release delete "$VERSION" --yes
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle immutable releases before force-pushing their tags

When release immutability is enabled and this job is rerun for a version whose published release already exists, the force-push on line 44 runs before this cleanup. gh release create --help documents that under immutable releases, “Git tags associated with a release cannot be modified or deleted,” so the push fails and these deletion lines are never reached, defeating the newly added release-recreation path. Handle the existing release before attempting to move its tag, or avoid force-updating the tag.

Useful? React with 👍 / 👎.

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