Skip to content

ex/chore: rename to WarehouseEx (#30) #25

ex/chore: rename to WarehouseEx (#30)

ex/chore: rename to WarehouseEx (#30) #25

Workflow file for this run

name: Publish Elixir package
on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- main
paths:
- ex/**
defaults:
run:
working-directory: ./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: |
ex/deps
key: mix-${{ hashFiles('**/mix.lock') }}
restore-keys: mix
- run: mix deps.get
- run: echo "short_sha=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
- run: echo "timestamp=`date +%s`" >> $GITHUB_ENV
- run: mix hex.publish package --yes
if: github.event_name == 'push'
env:
HEX_API_KEY: ${{ secrets.HEX_AUTH_TOKEN }}
WAREHOUSE_EX_PRERELEASE_VERSION: dev.${{env.timestamp}}.${{ 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 }}