diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1dcb8be11..6e6e03867 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,32 @@ +name: Release + on: - push: - tags: - - '*' + release: + types: [published] jobs: publish: + name: Publish runs-on: ubuntu-latest steps: - - name: Check out - uses: actions/checkout@v2 - - - name: Publish to Hex.pm - uses: erlangpack/github-action@v1 - env: - HEX_API_KEY: ${{ secrets.HEX_API_KEY }} \ No newline at end of file + - uses: actions/checkout@v2 + - name: Set up Elixir + uses: erlef/setup-elixir@v1 + with: + elixir-version: '1.11' + otp-version: '22.3' + - name: Restore dependencies cache + uses: actions/cache@v2 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + - name: Install dependencies + run: | + mix local.rebar --force + mix local.hex --force + mix deps.get + - name: Run Hex Publish + run: mix hex.publish --yes + env: + HEX_API_KEY: ${{ secrets.HEX_API_KEY }}