ci: OIDC Trusted Publishing 워크플로 (crates.io + npm)#28
Merged
Conversation
저장된 토큰/passkey 없이 태그 push 시 자동 publish하도록 GitHub Actions OIDC trusted publishing 워크플로 2개 추가. 다음 릴리스부터 cargo publish의 저장 토큰 (~/.cargo/credentials.toml)·npm passkey 수동 단계가 사라진다. - publish-crates.yml: rust-lang/crates-io-auth-action@v1로 OIDC→단기토큰 교환 후 cargo publish. macOS 전용 크레이트(IOKit FFI)라 verify 빌드가 Linux에서 실패하므로 release.yml과 동일하게 macos-14에서 실행. id-token: write. - publish-npm.yml: setup-node + npm@latest(OIDC는 npm>=11.5.1 요구) 후 npm publish ./npm. install.js가 GitHub Release 바이너리를 받는 래퍼라, 릴리스 에셋이 올라온 뒤 publish하도록 대기 게이트 추가(설치 실패 윈도우 방지). provenance 자동. id-token: write. 둘 다 태그 push(v*)에 트리거(release: published는 GITHUB_TOKEN 생성 릴리스라 미발화). run 스텝은 env var 경유로 인젝션 방지. 등록 폼의 "Workflow filename"은 각 파일명과 일치 (publish-crates.yml / publish-npm.yml). Environment name을 폼에 넣었다면 잡의 environment: 주석을 해제해야 OIDC 매칭됨. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
요약
저장된 토큰/passkey 없이 태그 push 시 자동 publish하는 OIDC trusted publishing 워크플로 2개.
rust-lang/crates-io-auth-action@v1(OIDC→단기토큰) →cargo publish. macOS 전용 크레이트라 macos-14에서 verify 빌드(Linux 불가).id-token: write.setup-node+npm@latest(OIDC는 npm ≥11.5.1) →npm publish ./npm. install.js가 릴리스 바이너리를 받는 래퍼라 릴리스 에셋 대기 게이트 후 publish. provenance 자동.id-token: write.설계 근거
v*).release: published는 release.yml이 GITHUB_TOKEN으로 릴리스를 만들어 downstream을 트리거 못 하므로 미사용.run:스텝은 env var 경유(인젝션 방지).주의
# environment: release주석을 해제(동일 값)해야 OIDC 매칭됨. 비웠다면 그대로.🤖 Generated with Claude Code