From bf07a3ac193712087cec66c7d532a89e6badfeb6 Mon Sep 17 00:00:00 2001 From: James Harton <59449+jimsynz@users.noreply.github.com> Date: Thu, 8 Dec 2022 16:02:51 +1300 Subject: [PATCH] chore: add publishing of releases to hex. (#29) --- .github/workflows/elixir_lib_release.yml | 33 ++++++++++++++++++++++++ LICENSE | 18 +++++++++++++ README.md | 2 +- mix.exs | 18 +++++++------ mix.lock | 2 +- 5 files changed, 63 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/elixir_lib_release.yml create mode 100644 LICENSE diff --git a/.github/workflows/elixir_lib_release.yml b/.github/workflows/elixir_lib_release.yml new file mode 100644 index 0000000..7826a81 --- /dev/null +++ b/.github/workflows/elixir_lib_release.yml @@ -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 }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5b151aa --- /dev/null +++ b/LICENSE @@ -0,0 +1,18 @@ +Copyright 2022 Alembic Pty Ltd. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index e600a9b..47cd8e5 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ defmodule MyAppWeb.Router do pipe_through :browser sign_in_route sign_out_route MyAppWeb.AuthController - auth_routes MyAppWeb.AuthController + auth_routes_for MyApp.Accounts.User, to: MyAppWeb.AuthController end end ``` diff --git a/mix.exs b/mix.exs index fa24356..f9747ce 100644 --- a/mix.exs +++ b/mix.exs @@ -8,6 +8,7 @@ defmodule AshAuthentication.Phoenix.MixProject do [ app: :ash_authentication_phoenix, version: @version, + description: "Phoenix integration for Ash Authentication", elixir: "~> 1.14", start_permanent: Mix.env() == :prod, preferred_cli_env: [ci: :test], @@ -43,11 +44,11 @@ defmodule AshAuthentication.Phoenix.MixProject do Components: [ AshAuthentication.Phoenix.SignInLive, AshAuthentication.Phoenix.Components.SignIn, - AshAuthentication.Phoenix.Components.OAuth2Authentication, - AshAuthentication.Phoenix.Components.PasswordAuthentication, - AshAuthentication.Phoenix.Components.PasswordAuthentication.SignInForm, - AshAuthentication.Phoenix.Components.PasswordAuthentication.RegisterForm, - AshAuthentication.Phoenix.Components.PasswordAuthentication.Input + AshAuthentication.Phoenix.Components.OAuth2, + AshAuthentication.Phoenix.Components.Password, + AshAuthentication.Phoenix.Components.Password.SignInForm, + AshAuthentication.Phoenix.Components.Password.RegisterForm, + AshAuthentication.Phoenix.Components.Password.Input ], Internals: ~r/.*/ ] @@ -58,14 +59,15 @@ defmodule AshAuthentication.Phoenix.MixProject do def package do [ maintainers: [ - "James Harton " + "James Harton ", + "Zach Daniel " ], licenses: ["MIT"], links: %{ "Source" => "https://github.com/team-alembic/ash_authentication_phoenix" }, source_url: "https://github.com/team-alembic/ash_authentication_phoenix", - files: ~w(lib .formatter.exs mix.exs README* LICENSE* CHANGELOG*) + files: ~w[lib .formatter.exs mix.exs README* LICENSE* CHANGELOG* documentation] ] end @@ -87,7 +89,7 @@ defmodule AshAuthentication.Phoenix.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:ash_authentication, github: "team-alembic/ash_authentication", tag: "v3.0.3"}, + {:ash_authentication, "~> 3.0"}, {:ash_phoenix, "~> 1.1"}, {:ash, "~> 2.2"}, {:jason, "~> 1.0"}, diff --git a/mix.lock b/mix.lock index 9a87463..0e40892 100644 --- a/mix.lock +++ b/mix.lock @@ -1,6 +1,6 @@ %{ "ash": {:hex, :ash, "2.4.20", "678f86b9150644d3bfc6f3999adbd86fb515ec6484cb5ff1af990faddb231d64", [:mix], [{:comparable, "~> 1.0", [hex: :comparable, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: true]}, {:ecto, "~> 3.7", [hex: :ecto, repo: "hexpm", optional: false]}, {:ets, "~> 0.8.0", [hex: :ets, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:picosat_elixir, "~> 0.2", [hex: :picosat_elixir, repo: "hexpm", optional: false]}, {:plug, ">= 0.0.0", [hex: :plug, repo: "hexpm", optional: true]}, {:spark, "~> 0.2 and >= 0.2.10", [hex: :spark, repo: "hexpm", optional: false]}, {:stream_data, "~> 0.5.0", [hex: :stream_data, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2c86c0eefeb1b9e9fe7a1af31d8d32a58cc5ebbd5a7741eed2545edaf5d0f192"}, - "ash_authentication": {:git, "https://github.com/team-alembic/ash_authentication.git", "20c7c20b108c6f5d547b4db0d8f0890e7b59f5e7", [tag: "v3.0.3"]}, + "ash_authentication": {:hex, :ash_authentication, "3.0.3", "a00a19a2c60a115d530e27ab5a2d768f998069e61d66073254be477394e42361", [:mix], [{:ash, "~> 2.4", [hex: :ash, repo: "hexpm", optional: false]}, {:assent, "~> 0.2", [hex: :assent, repo: "hexpm", optional: false]}, {:bcrypt_elixir, "~> 3.0", [hex: :bcrypt_elixir, repo: "hexpm", optional: false]}, {:castore, "~> 0.1", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:joken, "~> 2.5", [hex: :joken, repo: "hexpm", optional: false]}, {:mint, "~> 1.4", [hex: :mint, repo: "hexpm", optional: false]}, {:plug, "~> 1.13", [hex: :plug, repo: "hexpm", optional: false]}, {:spark, "~> 0.2.12", [hex: :spark, repo: "hexpm", optional: false]}], "hexpm", "689e0b3735ab95c6e30c484ae34bf6edb5a66fb37befa4cb7dab77ebd93ddaa8"}, "ash_phoenix": {:hex, :ash_phoenix, "1.1.2", "36c46852fa0e739d7217092ac71e3a72e729d5c00758f401234215d8d32f350b", [:mix], [{:ash, "~> 2.0", [hex: :ash, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.5.6 or ~> 1.6", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_live_view, "~> 0.15", [hex: :phoenix_live_view, repo: "hexpm", optional: false]}], "hexpm", "9afb2c9e8dbb68d3549713b4a96b56801c250489efdf4776b931770bd629e0bd"}, "assent": {:hex, :assent, "0.2.1", "46ad0ed92b72330f38c60bc03c528e8408475dc386f48d4ecd18833cfa581b9f", [:mix], [{:castore, "~> 0.1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, ">= 0.0.0", [hex: :certifi, repo: "hexpm", optional: true]}, {:jose, "~> 1.8", [hex: :jose, repo: "hexpm", optional: true]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: true]}, {:ssl_verify_fun, ">= 0.0.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: true]}], "hexpm", "58c558b6029ffa287e15b38c8e07cd99f0b24e4846c52abad0c0a6225c4873bc"}, "bcrypt_elixir": {:hex, :bcrypt_elixir, "3.0.1", "9be815469e6bfefec40fa74658ecbbe6897acfb57614df1416eeccd4903f602c", [:make, :mix], [{:comeonin, "~> 5.3", [hex: :comeonin, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "486bb95efb645d1efc6794c1ddd776a186a9a713abf06f45708a6ce324fb96cf"},