Skip to content

Commit c5bf597

Browse files
committed
ci: fix hex authentication in release workflow
Configure hex.config file with API key before publishing to properly authenticate with hex.pm. The HEX_API_KEY environment variable alone is not sufficient for rebar3 hex commands.
1 parent 93da416 commit c5bf597

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,20 @@ jobs:
4444
test -f doc/index.html || (echo "doc/index.html not found" && exit 1)
4545
echo "Documentation built successfully"
4646
47-
- name: Publish to Hex
48-
run: rebar3 hex publish --yes
47+
- name: Configure Hex authentication
48+
run: |
49+
mkdir -p ~/.config/rebar3
50+
cat > ~/.config/rebar3/hex.config <<EOF
51+
{api_key, <<"$HEX_API_KEY">>}.
52+
EOF
4953
env:
5054
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
5155

56+
- name: Publish to Hex
57+
run: rebar3 hex publish --yes
58+
5259
- name: Publish docs to Hex
5360
run: rebar3 hex docs publish --yes
54-
env:
55-
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
5661

5762
- name: Extract release notes from CHANGELOG
5863
id: changelog

0 commit comments

Comments
 (0)