Skip to content

Publish

Publish #18

Workflow file for this run

name: Publish
on:
workflow_run:
workflows: ["Precomp NIFs"]
types: [completed]
jobs:
publish:
runs-on: ubuntu-latest
# Only publish when:
# 1. The precompiled NIFs workflow completed successfully
# 2. The trigger was a push event (not PR, etc.)
# 3. The push was for a valid version tag (v1.0.0, v2.1.3-beta, etc.)
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
startsWith(github.event.workflow_run.head_branch, 'v') &&
contains(github.event.workflow_run.head_branch, '.')
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Elixir and Rust
uses: ./.github/actions/setup-elixir-rust
- name: Download precompiled NIFs
run: mix rustler_precompiled.download DprintMarkdownFormatter.Native --all --ignore-unavailable
- name: Build hex package
run: mix hex.build
- name: Publish to Hex.pm
run: mix hex.publish --yes --replace
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}