-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (30 loc) · 1.07 KB
/
Copy pathpublish.yml
File metadata and controls
37 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 }}