Skip to content

Commit b8b199e

Browse files
committed
Publish releases to GitHub and Hex using CI
1 parent 8bc7742 commit b8b199e

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.circleci/config.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ jobs:
5555
paths:
5656
- _build
5757
- deps
58+
publish:
59+
docker:
60+
- image: hexpm/elixir:1.18.2-erlang-27.2.1-alpine-3.21.2
61+
steps:
62+
- checkout
63+
- run:
64+
name: Publish GitHub release
65+
command: |
66+
apk add --no-cache github-cli
67+
sed -n "/^## $CIRCLE_TAG/,/^## /p" CHANGELOG.md | sed '1d; /^## /d' > RELEASE_NOTES
68+
gh release create $CIRCLE_TAG --notes "$(cat RELEASE_NOTES)"
69+
- run:
70+
name: Publish to hex.pm
71+
command: |
72+
mix deps.get
73+
mix hex.publish --yes
5874
5975
workflows:
6076
checks:
@@ -64,3 +80,14 @@ workflows:
6480
matrix:
6581
parameters:
6682
tag: *tags
83+
filters:
84+
tags:
85+
only: /.*/
86+
- publish:
87+
requires:
88+
- build-test
89+
filters:
90+
tags:
91+
only: /^v.*/
92+
branches:
93+
ignore: /.*/

0 commit comments

Comments
 (0)