Skip to content

Publish with Workload Identity - #91

Merged
ericmj merged 1 commit into
mainfrom
publish-with-workload-identity
Oct 20, 2026
Merged

ericmj merged 1 commit into
mainfrom
publish-with-workload-identity

Conversation

@ericmj

@ericmj ericmj commented Oct 20, 2026

Copy link
Copy Markdown
Member

The Publish workflow exchanges the job's GitHub OIDC token for a token that can only publish castore, matched against the package's workload identity on hex.pm, instead of using the HEX_API_KEY secret. The job runs in the release environment that the workload identity names, with id-token: write, and keeps contents: write for the version tag publish.sh pushes. It installs Hex 2.6.0-dev from a pinned hexpm/hex commit, the first Hex that publishes with Workload Identity.

That Hex needs OTP 27 or later, so the job moves from OTP 25.3 and Elixir 1.14.3 to OTP 28 and Elixir 1.19, the versions CI lints with. actions/checkout moves from v3 to v6, the version CI uses, because v3's Node runtime is too old for GitHub's runners.

Before merging, castore needs a workload identity on hex.pm for elixir-mint/castore, workflow publish.yml and environment release, and this repository needs the release environment. Merging publishes nothing, because 1.0.21 is already on Hex, so the first exchange runs when the next certificate update bumps VERSION. After that publish, the HEX_API_KEY secret and its key on hex.pm can be removed.

The Publish workflow exchanges the job's GitHub OIDC token for a token that
can only publish castore, matched against the package's workload identity on
hex.pm, so it no longer uses the HEX_API_KEY secret. The job runs in the
release environment that the workload identity names and installs Hex
2.6.0-dev from a pinned hexpm/hex commit, the first Hex that publishes with
Workload Identity.

That Hex needs OTP 27 or later, so the job moves to OTP 28 and Elixir 1.19,
the versions CI lints with. actions/checkout moves to v6, the version CI
uses, because v3's Node runtime is too old for GitHub's runners.
@ericmj
ericmj marked this pull request as ready for review October 20, 2026 16:22
@ericmj
ericmj merged commit a04ca0f into main Oct 20, 2026
4 checks passed
@ericmj
ericmj deleted the publish-with-workload-identity branch October 20, 2026 16:23
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