Skip to content

Commit a91232b

Browse files
authored
update: deps and dev env (#68)
1 parent 9c4af52 commit a91232b

File tree

14 files changed

+364
-114
lines changed

14 files changed

+364
-114
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.6.2"
3+
}

.github/release-please-config.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"bootstrap-sha": "f471986",
3+
"pull-request-header": ":rocket: Want to release this?",
4+
"pull-request-title-pattern": "chore: release ${version}",
5+
"changelog-sections": [
6+
{
7+
"type": "feat",
8+
"section": "Features"
9+
},
10+
{
11+
"type": "feature",
12+
"section": "Features"
13+
},
14+
{
15+
"type": "fix",
16+
"section": "Bug Fixes"
17+
},
18+
{
19+
"type": "perf",
20+
"section": "Performance Improvements"
21+
},
22+
{
23+
"type": "revert",
24+
"section": "Reverts"
25+
},
26+
{
27+
"type": "docs",
28+
"section": "Documentation",
29+
"hidden": false
30+
},
31+
{
32+
"type": "style",
33+
"section": "Styles",
34+
"hidden": false
35+
},
36+
{
37+
"type": "chore",
38+
"section": "Miscellaneous Chores",
39+
"hidden": false
40+
},
41+
{
42+
"type": "refactor",
43+
"section": "Code Refactoring",
44+
"hidden": false
45+
},
46+
{
47+
"type": "test",
48+
"section": "Tests",
49+
"hidden": false
50+
},
51+
{
52+
"type": "build",
53+
"section": "Build System",
54+
"hidden": false
55+
},
56+
{
57+
"type": "ci",
58+
"section": "Continuous Integration",
59+
"hidden": false
60+
}
61+
],
62+
"extra-files": [
63+
{
64+
"type": "generic",
65+
"path": "README.md",
66+
"glob": false
67+
}
68+
],
69+
"packages": {
70+
".": {
71+
"release-type": "elixir"
72+
}
73+
},
74+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
75+
}

.github/workflows/ci.yml

Lines changed: 62 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,23 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
elixir: [1.18.1]
21-
otp: [27.0]
20+
include:
21+
- elixir: 1.18
22+
otp: 28
23+
- elixir: 1.18
24+
otp: 27
25+
- elixir: 1.18
26+
otp: 26
27+
- elixir: 1.17
28+
otp: 27
29+
- elixir: 1.17
30+
otp: 26
31+
- elixir: 1.17
32+
otp: 25
33+
- elixir: 1.16
34+
otp: 25
35+
- elixir: 1.16
36+
otp: 24
2237

2338
steps:
2439
- name: Checkout code
@@ -59,21 +74,37 @@ jobs:
5974
run: mix clean
6075

6176
- name: Check code formatting
77+
if: matrix.elixir != '1.16'
6278
run: mix format --check-formatted
6379

6480
- name: Run Credo
6581
run: mix credo --strict
6682

67-
static-analisys:
83+
static-analysis:
6884
runs-on: ubuntu-latest
6985

7086
env:
7187
MIX_ENV: test
7288

7389
strategy:
7490
matrix:
75-
elixir: [1.18.1]
76-
otp: [27.0]
91+
include:
92+
- elixir: 1.18
93+
otp: 28
94+
- elixir: 1.18
95+
otp: 27
96+
- elixir: 1.18
97+
otp: 26
98+
- elixir: 1.17
99+
otp: 27
100+
- elixir: 1.17
101+
otp: 26
102+
- elixir: 1.17
103+
otp: 25
104+
- elixir: 1.16
105+
otp: 25
106+
- elixir: 1.16
107+
otp: 24
77108

78109
steps:
79110
- name: Checkout code
@@ -110,29 +141,23 @@ jobs:
110141
if: steps.build-cache.outputs.cache-hit != 'true'
111142
run: mix deps.compile --warnings-as-errors
112143

113-
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
114-
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
115-
- name: Restore PLT cache
116-
uses: actions/cache/restore@v3
144+
# Ensure PLTs directory exists
145+
- name: Create PLTs directory
146+
run: mkdir -p priv/plts
147+
148+
# Cache PLTs based on Elixir & Erlang version + mix.lock hash
149+
- name: Restore/Save PLT cache
150+
uses: actions/cache@v4
117151
id: plt_cache
118152
with:
119-
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
120-
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
121153
path: priv/plts
154+
key: plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
122155

123156
# Create PLTs if no cache was found
124157
- name: Create PLTs
125158
if: steps.plt_cache.outputs.cache-hit != 'true'
126159
run: mix dialyzer --plt
127160

128-
- name: Save PLT cache
129-
uses: actions/cache/save@v3
130-
if: steps.plt_cache.outputs.cache-hit != 'true'
131-
id: plt_cache_save
132-
with:
133-
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
134-
path: priv/plts
135-
136161
- name: Run dialyzer
137162
run: mix dialyzer --format github
138163

@@ -144,8 +169,23 @@ jobs:
144169

145170
strategy:
146171
matrix:
147-
elixir: [1.18.1]
148-
otp: [27.0]
172+
include:
173+
- elixir: 1.18
174+
otp: 28
175+
- elixir: 1.18
176+
otp: 27
177+
- elixir: 1.18
178+
otp: 26
179+
- elixir: 1.17
180+
otp: 27
181+
- elixir: 1.17
182+
otp: 26
183+
- elixir: 1.17
184+
otp: 25
185+
- elixir: 1.16
186+
otp: 25
187+
- elixir: 1.16
188+
otp: 24
149189

150190
steps:
151191
- name: Checkout code
@@ -186,4 +226,4 @@ jobs:
186226
run: mix clean
187227

188228
- name: Run tests
189-
run: mix test
229+
run: mix test --warnings-as-errors

.github/workflows/publish.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish to Hex
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
env:
14+
MIX_ENV: test
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Elixir
21+
uses: erlef/setup-beam@v1
22+
with:
23+
elixir-version: 1.18
24+
otp-version: 28
25+
26+
- name: Cache Elixir deps
27+
uses: actions/cache@v4
28+
id: deps-cache
29+
with:
30+
path: deps
31+
key: ${{ runner.os }}-mix-hex-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
32+
33+
- name: Cache Elixir _build
34+
uses: actions/cache@v4
35+
id: build-cache
36+
with:
37+
path: _build
38+
key: ${{ runner.os }}-build-hex-${{ env.MIX_ENV }}-27-1.18-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
39+
40+
- name: Install deps
41+
if: steps.deps-cache.outputs.cache-hit != 'true'
42+
run: |
43+
mix local.rebar --force
44+
mix local.hex --force
45+
mix deps.get
46+
47+
- name: Compile deps
48+
if: steps.build-cache.outputs.cache-hit != 'true'
49+
run: mix deps.compile
50+
51+
- name: Compile
52+
run: mix compile --warnings-as-errors
53+
54+
- name: Run tests
55+
run: mix test --warnings-as-errors
56+
57+
- name: Check formatting
58+
run: mix format --check-formatted
59+
60+
- name: Run Credo
61+
run: mix credo --strict
62+
63+
- name: Publish to Hex
64+
env:
65+
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
66+
run: mix hex.publish --yes
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
branches:
5+
- main
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
name: Release Please
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
release_created: ${{ steps.release.outputs.release_created }}
18+
tag_name: ${{ steps.release.outputs.tag_name }}
19+
steps:
20+
- uses: googleapis/release-please-action@v4
21+
id: release
22+
with:
23+
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
24+
config-file: .github/release-please-config.json
25+
manifest-file: .github/.release-please-manifest.json

README.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def deps do
77
[
88
{:supabase_potion, "~> 0.6"}, # base SDK
99
{:supabase_storage, "~> 0.4"}, # storage integration
10-
{:supabase_gotrue, "~> 0.4"}, # auth integration
10+
{:supabase_auth, "~> 0.6"}, # auth integration
1111
{:supabase_postgrest, "~> 1.0"}, # postgrest integration
1212
{:supabase_functions, "~> 0.1"}, # edge functions integration
1313
{:supabase_realtime, "~> 0.1"}, # realtime integration
@@ -20,28 +20,13 @@ Individual product client documentation:
2020
- [PostgREST](https://github.com/supabase-community/postgres-ex)
2121
- [Storage](https://github.com/supabase-community/storage-ex)
2222
- [Auth](https://github.com/supabase-community/auth-ex)
23+
- [Functions](https://github.com/supabase-community/functions-ex)
24+
- [Realtime](https://github.com/supabase-community/realtime-ex)
2325

2426
### Clients
2527

2628
A `Supabase.Client` holds general information about Supabase, that can be used to intereact with any of the children integrations, for example: `Supabase.Storage` or `Supabase.UI`.
2729

28-
`Supabase.Client` is defined as:
29-
30-
- `:base_url` - The base url of the Supabase API, it is usually in the form `https://<app-name>.supabase.io`.
31-
- `:api_key` - The API key used to authenticate requests to the Supabase API.
32-
- `:access_token` - Token with specific permissions to access the Supabase API, it is usually the same as the API key.
33-
- `:db` - default database options
34-
- `:schema` - default schema to use, defaults to `"public"`
35-
- `:global` - global options config
36-
- `:headers` - additional headers to use on each request
37-
- `:auth` - authentication options
38-
- `:auto_refresh_token` - automatically refresh the token when it expires, defaults to `true`
39-
- `:debug` - enable debug mode, defaults to `false`
40-
- `:detect_session_in_url` - detect session in URL, defaults to `true`
41-
- `:flow_type` - authentication flow type, defaults to `"web"`
42-
- `:persist_session` - persist session, defaults to `true`
43-
- `:storage_key` - storage key
44-
4530
### Usage
4631

4732
There are two ways to create a `Supabase.Client`:

0 commit comments

Comments
 (0)