Skip to content

Commit 2c55aaf

Browse files
Merge pull request #2 from ipdata/claude/verify-all-tests-YVXdw
Add GitHub Actions workflow to publish to Hex.pm on new tags
2 parents b4fe489 + dd09d08 commit 2c55aaf

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Publish to Hex.pm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
test:
10+
name: Test
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
otp: ['25', '26', '27']
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: erlef/setup-beam@v1
19+
with:
20+
otp-version: ${{ matrix.otp }}
21+
rebar3-version: '3.24'
22+
23+
- name: Restore dependencies cache
24+
uses: actions/cache@v4
25+
with:
26+
path: _build
27+
key: ${{ runner.os }}-otp-${{ matrix.otp }}-build-${{ hashFiles('rebar.config') }}
28+
restore-keys: ${{ runner.os }}-otp-${{ matrix.otp }}-build-
29+
30+
- name: Compile
31+
run: rebar3 compile
32+
33+
- name: Run tests
34+
run: rebar3 ct
35+
36+
- name: Run dialyzer
37+
run: rebar3 dialyzer
38+
39+
- name: Run xref
40+
run: rebar3 xref
41+
42+
publish:
43+
name: Publish to Hex.pm
44+
needs: test
45+
runs-on: ubuntu-latest
46+
permissions:
47+
contents: read
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- uses: erlef/setup-beam@v1
52+
with:
53+
otp-version: '27'
54+
rebar3-version: '3.24'
55+
56+
- name: Restore dependencies cache
57+
uses: actions/cache@v4
58+
with:
59+
path: _build
60+
key: ${{ runner.os }}-otp-27-build-${{ hashFiles('rebar.config') }}
61+
restore-keys: ${{ runner.os }}-otp-27-build-
62+
63+
- name: Publish to Hex.pm
64+
run: rebar3 hex publish --yes
65+
env:
66+
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
67+
68+
- name: Generate docs
69+
run: rebar3 ex_doc
70+
71+
- name: Publish docs
72+
run: rebar3 hex docs publish --yes
73+
env:
74+
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}

0 commit comments

Comments
 (0)