mirror of
https://github.com/team-alembic/ash_authentication.git
synced 2024-09-20 05:13:10 +12:00
chore: add automatic publishing of new releases to hex. (#66)
This commit is contained in:
parent
afe6779b2a
commit
d8e1281c9b
3 changed files with 35 additions and 15 deletions
33
.github/workflows/elixir_lib_release.yml
vendored
Normal file
33
.github/workflows/elixir_lib_release.yml
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
name: Release an Elixir Library
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
jobs:
|
||||||
|
deps:
|
||||||
|
name: mix deps.get
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: team-alembic/staple-actions/actions/mix-deps-get@main
|
||||||
|
|
||||||
|
build-dev:
|
||||||
|
name: MIX_ENV=dev mix.compile
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: deps
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: team-alembic/staple-actions/actions/mix-compile@main
|
||||||
|
with:
|
||||||
|
mix-env: dev
|
||||||
|
|
||||||
|
publish:
|
||||||
|
name: MIX_ENV=dev mix hex.publish
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: build-dev
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: team-alembic/staple-actions/actions/mix-hex-publish@main
|
||||||
|
with:
|
||||||
|
mix-env: dev
|
||||||
|
hex-api-key: ${{ secrets.HEX_API_KEY }}
|
|
@ -9,7 +9,7 @@ defmodule AshAuthentication.TokenResource.Transformer do
|
||||||
require Ash.Expr
|
require Ash.Expr
|
||||||
alias Ash.{Resource, Type}
|
alias Ash.{Resource, Type}
|
||||||
alias AshAuthentication.{TokenResource, TokenResource.Info}
|
alias AshAuthentication.{TokenResource, TokenResource.Info}
|
||||||
alias Spark.{Dsl.Transformer, Error.DslError}
|
alias Spark.Dsl.Transformer
|
||||||
|
|
||||||
import AshAuthentication.Utils
|
import AshAuthentication.Utils
|
||||||
import AshAuthentication.Validations
|
import AshAuthentication.Validations
|
||||||
|
@ -306,20 +306,6 @@ defmodule AshAuthentication.TokenResource.Transformer do
|
||||||
defp build_expunge_expired_action(_dsl_state, action_name),
|
defp build_expunge_expired_action(_dsl_state, action_name),
|
||||||
do: Transformer.build_entity(Resource.Dsl, [:actions], :destroy, name: action_name)
|
do: Transformer.build_entity(Resource.Dsl, [:actions], :destroy, name: action_name)
|
||||||
|
|
||||||
defp validate_api_presence(dsl_state) do
|
|
||||||
case Transformer.get_option(dsl_state, [:token], :api) do
|
|
||||||
nil ->
|
|
||||||
{:error,
|
|
||||||
DslError.exception(
|
|
||||||
path: [:token, :api],
|
|
||||||
message: "An API module must be present"
|
|
||||||
)}
|
|
||||||
|
|
||||||
api ->
|
|
||||||
{:ok, api}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
defp validate_jti_field(dsl_state) do
|
defp validate_jti_field(dsl_state) do
|
||||||
with {:ok, resource} <- persisted_option(dsl_state, :module),
|
with {:ok, resource} <- persisted_option(dsl_state, :module),
|
||||||
{:ok, attribute} <- find_attribute(dsl_state, :jti),
|
{:ok, attribute} <- find_attribute(dsl_state, :jti),
|
||||||
|
|
1
mix.exs
1
mix.exs
|
@ -8,6 +8,7 @@ defmodule AshAuthentication.MixProject do
|
||||||
[
|
[
|
||||||
app: :ash_authentication,
|
app: :ash_authentication,
|
||||||
version: @version,
|
version: @version,
|
||||||
|
description: "User authentication support for Ash",
|
||||||
elixir: "~> 1.13",
|
elixir: "~> 1.13",
|
||||||
start_permanent: Mix.env() == :prod,
|
start_permanent: Mix.env() == :prod,
|
||||||
preferred_cli_env: [ci: :test],
|
preferred_cli_env: [ci: :test],
|
||||||
|
|
Loading…
Reference in a new issue