Skip to content

Commit

Permalink
prepare hex publish
Browse files Browse the repository at this point in the history
  • Loading branch information
pehbehbeh committed Dec 6, 2023
1 parent a17e5b9 commit 5bb4f45
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
release:
types: [published]

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: '26.1.2'
elixir-version: '1.15.7'

- name: Install Dependencies
run: mix deps.get

- name: Check Formatting
run: mix format --check-formatted

- name: Run Tests
run: mix test

- name: Publish package
if: github.event_name == 'release'
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: mix hex.publish --yes
10 changes: 10 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ defmodule Backpex.MixProject do
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
package: package(),
aliases: aliases(),
dialyzer: dialyzer(),

Expand Down Expand Up @@ -49,6 +50,15 @@ defmodule Backpex.MixProject do
]
end

defp package do
[
files: ~w(lib priv mix.exs README.md LICENSE.md),
maintainers: ["Florian Arens", "Phil-Bastian Berndt", "Simon Hansen"],
licenses: ["MIT"],
links: %{"GitHub" => @source_url}
]
end

defp aliases do
[
lint: ["format --check-formatted", "dialyzer", "credo", "sobelow --config"]
Expand Down

0 comments on commit 5bb4f45

Please sign in to comment.