Publish #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
workflow_dispatch: | |
jobs: | |
version: | |
name: Calculate version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.versioning.outputs.version-string }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Calculate semantic version | |
id: versioning | |
uses: bitshifted/git-auto-semver@v1.1.0 | |
with: | |
main_branch: main | |
create_tag: true | |
tag_prefix: "v" | |
publish: | |
name: Publish to Hex.pm | |
needs: version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: "1.16.2" | |
otp-version: "26.2.5" | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Generate docs | |
run: mix docs | |
- name: Publish to Hex.pm | |
env: | |
HEX_API_KEY: ${{ secrets.HEX_API_KEY }} | |
run: mix hex.publish --yes |