-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (46 loc) · 1.85 KB
/
release.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Release
on:
release:
types: [published]
env:
MIX_ENV: dev
REQUIRE_VERSION_FILE: true
CACHE_PREFIX_DEPS: v1-deps
CACHE_PREFIX_BUILD: v1-_build
jobs:
publish_to_hex:
name: Publish to Hex.pm
runs-on: ubuntu-latest
container: hexpm/elixir:1.11.2-erlang-22.3.4.3-alpine-3.11.6
env:
VERSION_ALPINE: 3.11.6
VERSION_ELIXIR: 1.11.2
VERSION_OTP: 22.3.4.3
steps:
- uses: actions/checkout@v2
- name: Write the release version to the version file
run: |
echo "Create version file for $GITHUB_REF"
echo -n "${GITHUB_REF#refs/tags/v}" > version
- name: Cache - deps/
uses: actions/cache@v1
with:
path: deps/
key: ${{ env.CACHE_PREFIX_DEPS }}-env:${{ env.MIX_ENV }}-alpine:${{ env.VERSION_ALPINE }}-elixir:${{ env.VERSION_ELIXIR }}-otp:${{ env.VERSION_OTP }}-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ env.CACHE_PREFIX_DEPS }}-env:${{ env.MIX_ENV }}-alpine:${{ env.VERSION_ALPINE }}-elixir:${{ env.VERSION_ELIXIR }}-otp:${{ env.VERSION_OTP }}-
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get --only "$MIX_ENV"
- name: Cache - _build/
uses: actions/cache@v1
with:
path: _build/
key: ${{ env.CACHE_PREFIX_BUILD }}-env:${{ env.MIX_ENV }}-alpine:${{ env.VERSION_ALPINE }}-elixir:${{ env.VERSION_ELIXIR }}-otp:${{ env.VERSION_OTP }}-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ env.CACHE_PREFIX_BUILD }}-env:${{ env.MIX_ENV }}-alpine:${{ env.VERSION_ALPINE }}-elixir:${{ env.VERSION_ELIXIR }}-otp:${{ env.VERSION_OTP }}-
- run: mix compile --warnings-as-errors
- name: Publish to Hex.pm
run: mix hex.publish --yes
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}