-
Notifications
You must be signed in to change notification settings - Fork 0
ci: リリースPRマージ時の処理をタグ作成とGitHub Release公開だけにする #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
db72601
5fc5b19
d521e8f
236ea39
f0fd261
3be03e2
76d999b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,14 @@ | ||
| name: Release Merged | ||
|
|
||
| # doc/adr/0016: リリースPR(release/*ブランチ)がmainにマージされたことをトリガーに、 | ||
| # タグ作成 → GitHub Release publish → メタデータ同期 → Xcode Cloud起動 の順で実行する。 | ||
| # 実行順序を保証するため、あえて1ジョブの直列ステップとして書く(並列ジョブにしない)。 | ||
| # doc/adr/0027: リリースPR(release/*ブランチ)がmainにマージされたことをトリガーに、 | ||
| # タグ作成 → GitHub Release publish だけを行う。 | ||
| # メタデータ同期(sync-metadata.yml)とApp Storeへのビルドアップロードはここからは起動しない。 | ||
| on: | ||
| pull_request: | ||
| types: [closed] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| actions: write | ||
|
|
||
| jobs: | ||
| release: | ||
|
|
@@ -46,31 +45,17 @@ jobs: | |
|
|
||
| - name: Publish GitHub Release | ||
| run: | | ||
| # 同じバージョンのReleaseが既にあれば削除して作り直す(タグと同様に上書き扱いにする)。 | ||
| # --cleanup-tagは付けない(直前でpushしたタグまで消えてしまうため) | ||
| if gh release view "$VERSION" > /dev/null 2>&1; then | ||
| gh release delete "$VERSION" --yes | ||
| fi | ||
| gh release create "$VERSION" \ | ||
| --title "$VERSION" \ | ||
| --generate-notes \ | ||
| --latest \ | ||
| --target main | ||
|
|
||
| - name: Trigger metadata sync workflow | ||
| run: gh workflow run sync-metadata.yml --ref main -f version="$VERSION" | ||
|
|
||
| - name: Trigger Xcode Cloud Upload For AppStore build | ||
| env: | ||
| ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }} | ||
| ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | ||
| ASC_SECRET_KEY: ${{ secrets.ASC_SECRET_KEY }} | ||
| XCODE_CLOUD_APPSTORE_WORKFLOW_ID: ${{ secrets.XCODE_CLOUD_APPSTORE_WORKFLOW_ID }} | ||
| run: | | ||
| KEY_PATH="$(mktemp)" | ||
| echo "$ASC_SECRET_KEY" | base64 -d > "$KEY_PATH" | ||
| if [ ! -s "$KEY_PATH" ]; then | ||
| echo "::error::ASC_SECRET_KEY のデコード結果が空でした。シークレットの設定値を確認してください" | ||
| exit 1 | ||
| fi | ||
| 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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a release PR is created through Useful? React with 👍 / 👎.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ご指摘ありがとうございます。f0fd2616 で対応しました。
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 追加対応: 3be03e2 でマージ後の手動手順を削除しました。Xcode Cloudの「Upload For AppStore」の開始条件を |
||
| if: always() | ||
| run: | | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| ## タイトル: リリースPRマージ時の自動処理をタグ作成とGitHub Release公開だけに絞る | ||
|
|
||
| * **ステータス: 承認済** | ||
| * 意思決定者: @stotic-dev | ||
| * 日付: 2026-09-29 | ||
| * 技術的背景やその他関連チケット No: [ADR-0016](0016-release-pipeline-automation.md) の一部を置き換える | ||
|
|
||
| ## 文脈、背景や問題点の説明 | ||
|
|
||
| [ADR-0016](0016-release-pipeline-automation.md) では、リリースPRのmainマージをトリガーに `release-merged.yml` が「タグ作成 → GitHub Release publish → メタデータ同期 → Xcode Cloud起動」を直列で実行する構成にした。 | ||
|
|
||
| v1.0.0のリリースで、このうちXcode Cloud起動のステップが失敗した(`XCODE_CLOUD_APPSTORE_WORKFLOW_ID` のシークレットが登録されておらず、`scripts/trigger-xcode-cloud-build.sh` に空のワークフローIDが渡った)。一方で、Xcode Cloudの「Upload For AppStore」は開始条件が「すべてのタグ」になっており、`release-merged.yml` がpushしたタグで起動していた。つまりAPIでの起動ステップは不要で、マージ時にメタデータ同期とApp Storeへのビルドアップロードが自動で走ること自体も望んでいなかった。マージ時に自動で走らせたい処理は、タグ付けとGitHub Releaseの公開だけだった。 | ||
|
|
||
| ## 決定事項 | ||
|
|
||
| * `release-merged.yml` が行う処理を「タグ作成・push」と「GitHub Release作成・publish」だけにする | ||
| * メタデータ同期(`sync-metadata.yml`)の起動と、Xcode Cloud「Upload For AppStore」の起動をワークフローから外す | ||
| * `sync-metadata.yml` 自体は残し、必要なときに `workflow_dispatch` で手動実行する | ||
| * 呼び出し元がなくなった `scripts/trigger-xcode-cloud-build.sh` を削除する | ||
| * 起動するワークフローがなくなったので、`release-merged.yml` の `actions: write` 権限を外す | ||
| * Xcode Cloud「Upload For AppStore」の開始条件を「すべてのタグ」から「`release/` ブランチへの変更」に変える(App Store Connect側の設定のため、リポジトリでは管理しない) | ||
| * タグのpushでは起動しなくなり、リリースPRへのpushの度にApp Store Connectへビルドがアップロードされる | ||
|
|
||
| ## 考慮した選択肢 | ||
|
|
||
| * **シークレットを登録してADR-0016の構成を維持する**: マージからビルドのアップロードまで自動化できる。ただし、`ciBuildRuns` を作成する部分は一度も動作確認できておらず、自動化したい範囲でもないため採用しない | ||
| * **タグ作成とGitHub Release公開だけに絞る**: 採用 | ||
|
|
||
| ## 決定結果 | ||
|
|
||
| ### 決定にあたり考慮したメリット | ||
|
|
||
| * 動作確認できていないAPI呼び出しや、未登録のシークレットが原因でリリースワークフローが失敗しなくなる | ||
| * リリースPRのマージがApp Store Connectへの反映を伴わなくなり、マージの影響範囲がタグとGitHub Releaseに限られる | ||
| * ワークフローが必要とするシークレット・権限が減る(ASC APIキー、`actions: write` が不要になる) | ||
|
|
||
| ### 決定にあたり考慮したデメリット | ||
|
|
||
| * メタデータ同期は必要なときに手動で実行する必要がある | ||
| * 「Upload For AppStore」の開始条件はApp Store Connect側の設定で、リポジトリの記述と食い違っても気付きにくい | ||
|
|
||
| ## 参考 | ||
|
|
||
| * [ADR-0016](0016-release-pipeline-automation.md) | ||
| * `.github/workflows/release-merged.yml` | ||
| * `.github/workflows/sync-metadata.yml` |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 --helpdocuments 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 👍 / 👎.