-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (37 loc) · 1.08 KB
/
cd.yml
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
38
39
name: CD
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Setup Elixir
uses: erlef/setup-beam@v1
with:
otp-version: 25.0.4
elixir-version: 1.14.3
- name: Checkout
uses: actions/checkout@v3
- name: setup hex
run: |
mix local.hex --force
mix local.rebar --force
- name: get deps
run: mix deps.get
- name: get tag
run: |
REDACT_EX_VERSION_REPO=$(grep -m1 version mix.exs | cut -d'"' -f2)
echo "REDACT_EX_VERSION_REPO=$REDACT_EX_VERSION_REPO" >> $GITHUB_ENV
- name: check tags
if: github.ref_tag != ${{ env.REDACT_EX_VERSION_REPO }}
run: |
echo "Github ref tag [${{ github.ref_tag }}] is different from mix.exs version [${{ env.REDACT_EX_VERSION_REPO }}]"
exit 1
- name: Login to hex.pm
run: |
mix hex.config api_key "$HEX_AUTH_KEY"
env:
HEX_AUTH_KEY: ${{ secrets.HEX_AUTH_KEY }}
- name: Publish
run: mix hex.publish --yes