Skip to content

Merge pull request #4 from Logflare/chore/hexpm-publishing #2

Merge pull request #4 from Logflare/chore/hexpm-publishing

Merge pull request #4 from Logflare/chore/hexpm-publishing #2

Workflow file for this run

name: Publish dev package
on:
release:
types: [published]
push:
branches:
- main
paths:
- logflare-ex/**
defaults:
run:
working-directory: ./logflare-ex
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v3
with:
path: |
logflare-ex/deps
key: mix-${{ hashFiles('**/mix.lock') }}
restore-keys: mix
- run: mix deps.get
- run: echo "short_sha=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- run: mix hex.publish --yes
if: github.event_name != 'release'
env:
HEX_API_KEY: ${{ secrets.HEX_AUTH_TOKEN }}
MIX_PROJECT_VERSION: dev-${{ env.short_sha }}
- run: mix hex.publish --yes
if: github.event_name == 'release'
env:
HEX_API_KEY: ${{ secrets.HEX_AUTH_TOKEN }}