Skip to content

Publish New Release

Publish New Release #7

Workflow file for this run

name: Publish New Release
on:
workflow_dispatch:
inputs:
version:
type: choice
description: What version to publish?
options:
- patch
- minor
- major
changes:
description: Specify an entry for the changelog
required: true
jobs:
ci:
uses: ./.github/workflows/elixir.yml
secrets: inherit
publish:
needs: [ci]
name: Build and publish to hex.pm
runs-on: ubuntu-20.04
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_PUBLISH_PAT }}
fetch-depth: 0
ref: master
- name: Git Config
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Setup Elixir
uses: erlef/setup-elixir@v1
with:
otp-version: '24.0'
elixir-version: '1.12'
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-publish-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-publish-mix-
- name: Install deps
run: mix deps.get
- name: Add changelog entry
run: echo "${{ inputs.changes }}" > RELEASE.md
- name: Bump version, generate changelog, push to git, publish on hex.pm
run: mix expublish.${{ inputs.version }} --disable-test