Skip to content

Publish Elixir package #5

Publish Elixir package

Publish Elixir package #5

Workflow file for this run

name: Publish Elixir package
on:
workflow_dispatch:
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 == 'push'
env:
HEX_API_KEY: ${{ secrets.HEX_AUTH_TOKEN }}
PRERELEASE_VERSION: dev-${{ env.short_sha }}
- run: mix hex.publish --yes
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
env:
HEX_API_KEY: ${{ secrets.HEX_AUTH_TOKEN }}