forked from electricshaman/hippy
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (45 loc) · 1.32 KB
/
release.yml
File metadata and controls
57 lines (45 loc) · 1.32 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Elixir and OTP
uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
- name: Install Hex and Rebar
run: |
mix local.hex --force
mix local.rebar --force
- name: Install dependencies
run: mix deps.get --check-locked
- name: Run tests
run: mix test
- name: Verify tag matches app version
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
APP_VERSION="$(elixir -e 'IO.puts(Application.spec(:hippy, :vsn))')"
if [ -z "$APP_VERSION" ]; then
echo "Could not read app version"
exit 1
fi
if [ "$TAG_VERSION" != "$APP_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match app version ($APP_VERSION)"
exit 1
fi
- name: Publish package to Hex
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: mix hex.publish --organization draftkings --yes
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true