Skip to content

Commit

Permalink
feat: prepare for refactored minor version
Browse files Browse the repository at this point in the history
- remove unecessary and confuse option `manege_clients`
  - users should manage OTP process on their own
  - client struct should be simpler to use and manage
  - client initialization should be very explicit
    - no more infinite ways to "start" a client, just create a raw struct
- remove old documentation
- update elixir and erlang OTP source versions
- remove usage of earthly on top of old github actions
- add support for local dev with `asdf`
- add local `.env.dev` for usage with supabase cli
  • Loading branch information
zoedsoupe committed Aug 30, 2024
1 parent 6947423 commit 3440262
Show file tree
Hide file tree
Showing 25 changed files with 221 additions and 554 deletions.
2 changes: 2 additions & 0 deletions .env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export SUPABASE_URL=http://127.0.0.1:54321
export SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
61 changes: 31 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,39 @@ name: ci

on:
push:
branches: [ main ]
branches:
- main
pull_request:
branches: [ main ]
branches:
- main

jobs:
build:
lint:
runs-on: ubuntu-latest
env:
GHCR_USERNAME: ${{ github.actor }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
FORCE_COLOR: 1

strategy:
matrix:
elixir: [1.17.0]
otp: [27.0]

steps:
- uses: actions/checkout@v3
- name: Put back the git branch into git (Earthly uses it for tagging)
run: |
branch=""
if [ -n "$GITHUB_HEAD_REF" ]; then
branch="$GITHUB_HEAD_REF"
else
branch="${GITHUB_REF##*/}"
fi
git checkout -b "$branch" || true
- name: Docker Login
run: docker login https://ghcr.io --username "$GHCR_USERNAME" --password "$GHCR_TOKEN"
- name: Download latest earthly
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"

- name: Earthly version
run: earthly --version

- name: Run CI
run: earthly -P +ci

- name: Run Tests
run: earthly -P +test
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}

- name: Install dependencies
run: mix deps.get

- name: Clean build
run: mix clean

- name: Check code formatting
run: mix format --check-formatted

- name: Run Credo
run: mix credo --strict
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.15.7]
otp: [26.1.2]
elixir: [1.17.0]
otp: [27.0]
steps:
- uses: actions/checkout@v3
- name: Set up Elixir
Expand Down
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
erlang 27.0
elixir 1.17.0-otp-27
33 changes: 0 additions & 33 deletions Earthfile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ To install the base SDK:
```elixir
def deps do
[
{:supabase_potion, "~> 0.3"}
{:supabase_potion, "~> 0.4"}
]
end
```
Expand Down
1 change: 0 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Config

if config_env() == :dev do
config :supabase_potion,
manage_clients: true,
supabase_base_url: System.get_env("SUPABASE_URL"),
supabase_api_key: System.get_env("SUPABASE_KEY")
end
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "Supabase SDK for Elixir";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
systems.url = "github:nix-systems/default";
};
Expand All @@ -19,9 +19,9 @@
system,
...
}: let
inherit (pkgs.beam.interpreters) erlangR26;
inherit (pkgs.beam.interpreters) erlang_27;
inherit (pkgs.beam) packagesWith;
beam = packagesWith erlangR26;
beam = packagesWith erlang_27;
in {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
Expand All @@ -31,7 +31,7 @@
mkShell {
name = "supabase-ex";
packages = with pkgs;
[beam.elixir_1_16]
[beam.elixir_1_17]
++ lib.optional stdenv.isLinux [inotify-tools]
++ lib.optional stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreServices
Expand Down
64 changes: 0 additions & 64 deletions guides/fetcher.md

This file was deleted.

56 changes: 0 additions & 56 deletions guides/storage.md

This file was deleted.

Loading

0 comments on commit 3440262

Please sign in to comment.