ci(publish): GCP Artifact Registry への publish を導入する#4
Open
april418 wants to merge 2 commits into
Open
Conversation
npm registry への手動 publish 運用から、IMUID-js と同じ asia-northeast1 の Artifact Registry (intimatemerger プロジェクト 配下の npm-intimatemerger-internal repo) への自動 publish に 切り替える。master push をトリガにして WIF 経由で認証 → build → google-artifactregistry-auth で .npmrc に token を埋める → yarn publish の流れにする。 合わせて以下を整理する: - package.json の name を @intimatemerger/im-ulid から @intimatemerger-internal/im-ulid にリネーム。下流リポ (trust360 / im-cmp / IMUID-js / gpt-secure-signal-provider-js / beacon.js) は別途 @intimatemerger-internal/im-ulid への switch が 必要なのだ。 - files フィールドを ["dist"] に明示。これまでは未指定で repo 全体が publish 対象に含まれていたが、AR には dist/ だけ載れば十分なので payload を最小化する。 NODE_OPTIONS=--openssl-legacy-provider は test.yml と同じ理由 (webpack 5.44 が node 17+ で ERR_OSSL_EVP_UNSUPPORTED で落ちる) で env に置く。migration PR で webpack 5.105+ に上がれば不要に なる。 GitHub repo 側の設定 (WORKLOAD_IDENTITY_PROVIDER / WORKLOAD_IDENTITY_SERVICE_ACCOUNT vars) と GCP 側の AR 権限・ SA 作成は本コミットの範囲外。マージ前にリポジトリ admin が 設定する想定なのだ。 Co-Authored-By: Claude <noreply@anthropic.com>
GitHub repo の Actions vars に依存する形だと設定漏れで失敗するため、 リポ admin が GitHub 側で vars を仕込む手間を省く目的で、共有の WIF provider (intimatemerger-access の github-actions-pool) と 共有の SA (gha-artifactregistry@intimatemerger.iam.gserviceaccount.com) をワークフローに直接書き込む。 Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm registry への手動 publish 運用から、IMUID-js と同じ
asia-northeast1 の Artifact Registry (intimatemerger プロジェクト
配下の `npm-intimatemerger-internal` repo) への自動 publish に
切り替えるのだ。
リファレンス:
IntimateMerger/IMUID-js/.github/workflows/publish-to-artifactregistry.yml
migration PR (#1) とは独立した PR として進めるのだ。
マージ順序は問わないが、AR publish が動くのは pnpm 移行とは無関係なので
こちらだけ先にマージしても問題ないのだ。
Changes
`vars.WORKLOAD_IDENTITY_SERVICE_ACCOUNT`)
`yarn run artifactregistry-login` → `yarn publish --non-interactive --no-git-tag-version`
置く (webpack 5.44 が node 17+ で落ちる対策)
マージ前に必要な GCP / GitHub 設定
リポジトリ admin / GCP admin が以下を実施する必要があるのだ:
GCP 側
(principalSet で `IntimateMerger/im-ulid` repo 全体に対して)
GitHub 側
`Settings > Variables > Actions` で:
詳細手順は監査リポの AR_PUBLISH_SETUP.md (社内 doc) を参照するのだ。
Test plan
Co-Authored-By: Claude noreply@anthropic.com