Skip to content

Commit 42a1b3c

Browse files
authored
config: release-please (#15)
1 parent 3eee6ac commit 42a1b3c

File tree

9 files changed

+247
-53
lines changed

9 files changed

+247
-53
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
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: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
elixir: [1.18.1]
21-
otp: [27.0]
20+
include:
21+
- elixir: 1.18
22+
otp: 27
23+
- elixir: 1.18
24+
otp: 26
25+
- elixir: 1.17
26+
otp: 27
27+
- elixir: 1.17
28+
otp: 26
29+
- elixir: 1.17
30+
otp: 25
2231

2332
steps:
2433
- name: Checkout code
@@ -64,16 +73,25 @@ jobs:
6473
- name: Run Credo
6574
run: mix credo --strict
6675

67-
static-analisys:
76+
static-analysis:
6877
runs-on: ubuntu-latest
6978

7079
env:
7180
MIX_ENV: test
7281

7382
strategy:
7483
matrix:
75-
elixir: [1.18.1]
76-
otp: [27.0]
84+
include:
85+
- elixir: 1.18
86+
otp: 27
87+
- elixir: 1.18
88+
otp: 26
89+
- elixir: 1.17
90+
otp: 27
91+
- elixir: 1.17
92+
otp: 26
93+
- elixir: 1.17
94+
otp: 25
7795

7896
steps:
7997
- name: Checkout code
@@ -110,29 +128,25 @@ jobs:
110128
if: steps.build-cache.outputs.cache-hit != 'true'
111129
run: mix deps.compile --warnings-as-errors
112130

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
131+
# Ensure PLTs directory exists
132+
- name: Create PLTs directory
133+
run: mkdir -p priv/plts
134+
135+
# Cache PLTs based on Elixir & Erlang version + mix.lock hash
136+
- name: Restore/Save PLT cache
137+
uses: actions/cache@v4
117138
id: plt_cache
118139
with:
119-
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
120-
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
121140
path: priv/plts
141+
key: plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
142+
restore-keys: |
143+
plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
122144
123145
# Create PLTs if no cache was found
124146
- name: Create PLTs
125147
if: steps.plt_cache.outputs.cache-hit != 'true'
126148
run: mix dialyzer --plt
127149

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-
136150
- name: Run dialyzer
137151
run: mix dialyzer --format github
138152

@@ -144,8 +158,17 @@ jobs:
144158

145159
strategy:
146160
matrix:
147-
elixir: [1.18.1]
148-
otp: [27.0]
161+
include:
162+
- elixir: 1.18
163+
otp: 27
164+
- elixir: 1.18
165+
otp: 26
166+
- elixir: 1.17
167+
otp: 27
168+
- elixir: 1.17
169+
otp: 26
170+
- elixir: 1.17
171+
otp: 25
149172

150173
steps:
151174
- name: Checkout code
@@ -186,4 +209,4 @@ jobs:
186209
run: mix clean
187210

188211
- name: Run tests
189-
run: mix test
212+
run: mix test --warnings-as-errors
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Add `supabase_realtime` to your list of dependencies in `mix.exs`:
2424
def deps do
2525
[
2626
{:supabase_potion, "~> 0.6"},
27-
{:supabase_realtime, "~> 0.1"}
27+
{:supabase_realtime, "~> 0.1.0"} # x-release-version
2828
]
2929
end
3030
```

flake.lock

Lines changed: 74 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
{
2-
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05-small";
4+
elixir-overlay.url = "github:zoedsoupe/elixir-overlay";
5+
};
36

4-
outputs = {nixpkgs, ...}: let
7+
outputs = {
8+
nixpkgs,
9+
elixir-overlay,
10+
...
11+
}: let
512
inherit (nixpkgs.lib) genAttrs;
613
inherit (nixpkgs.lib.systems) flakeExposed;
714
forAllSystems = f:
8-
genAttrs flakeExposed (system: f (import nixpkgs {inherit system;}));
15+
genAttrs flakeExposed (system:
16+
f (import nixpkgs {
17+
inherit system;
18+
overlays = [elixir-overlay.overlays.default];
19+
}));
920
in {
1021
devShells = forAllSystems (pkgs: let
1122
inherit (pkgs) mkShell;
1223
inherit (pkgs.beam.interpreters) erlang_27;
13-
inherit (pkgs.beam) packagesWith;
14-
beam = packagesWith erlang_27;
15-
elixir_1_18 = beam.elixir.override {
16-
version = "1.18.2";
17-
18-
src = pkgs.fetchFromGitHub {
19-
owner = "elixir-lang";
20-
repo = "elixir";
21-
rev = "v1.18.2";
22-
sha256 = "sha256-8FhUKAaEjBBcF0etVPdkxMfrnR5niU40U8cxDRJdEok=";
23-
};
24-
};
2524
in {
2625
default = mkShell {
2726
name = "realtime-ex";
28-
packages = [elixir_1_18 erlang_27];
27+
packages = with pkgs; [elixir-bin."1.18.4" erlang_27 postgresql];
2928
};
3029
});
3130
};

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defmodule Supabase.Realtime.MixProject do
88
[
99
app: :supabase_realtime,
1010
version: @version,
11-
elixir: "~> 1.18",
11+
elixir: "~> 1.17",
1212
start_permanent: Mix.env() == :prod,
1313
deps: deps(),
1414
docs: docs(),

0 commit comments

Comments
 (0)