Skip to content

Commit 3ac12da

Browse files
committed
ci: setup release tools
1 parent 8509739 commit 3ac12da

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Hex Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
publish:
13+
name: Publish to Hex
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: erlef/setup-beam@v1
18+
with:
19+
elixir-version: "1.14"
20+
otp-version: "24"
21+
- run: mix deps.get
22+
- run: mix test
23+
- run: mix hex.publish --yes
24+
env:
25+
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}

release.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Release script
5+
#
6+
# Usage:
7+
# 1. Set new version in mix.exs
8+
# 2. Commit and push
9+
# 3. Run ./release.sh
10+
# 4. Let .github/workflows/publish.yml to publish
11+
12+
version=$(mix run -e 'IO.puts(Mix.Project.config[:version])')
13+
git tag "v$version"
14+
git push "v$version"

0 commit comments

Comments
 (0)