Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #169

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/check-deps.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash -e

GITHUB_PR_LABEL="dependencies"
COMMIT_TITLE="Update dependencies"

if [ -z "$BRANCH_NAME" ]; then
echo "Branch name is required"
Expand All @@ -19,13 +20,15 @@ _update_output="$(TERM=dumb rebar3 update-deps --replace)"
if git diff --exit-code --quiet; then
echo "No changes to the dependencies"
exit 0
else
echo "Detected changes to dependencies"
fi

git checkout -b "$BRANCH_NAME"
git add .

git commit -F- <<EOF
Update dependencies
$COMMIT_TITLE

Updates from "rebar3 update-deps --replace":

Expand All @@ -35,5 +38,16 @@ EOF
git push --set-upstream origin "$BRANCH_NAME"

if [[ $(check_pr) == "" ]]; then
gh pr create --fill --label "$GITHUB_PR_LABEL"
gh pr create \
--label "$GITHUB_PR_LABEL" \
--title "$COMMIT_TITLE" \
--body-file - <<EOF
This PR updates the dependencies to their latest versions.

The following changes were made from \`rebar3 update-deps --replace\`:

\`\`\`
$_update_output
\`\`\`
EOF
fi
2 changes: 2 additions & 0 deletions .github/workflows/check_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
rebar3-version: '3.22.1'
version-type: 'strict'

- uses: actions/cache@v4
Expand All @@ -39,3 +40,4 @@ jobs:
run: .github/workflows/check-deps.sh
env:
BRANCH_NAME: update-deps-${{ github.run_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130 changes: 54 additions & 76 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,85 +1,63 @@
%%-*- mode: erlang -*-
{cover_enabled, true}.
{erl_opts, [
debug_info,
fail_on_warning,
{platform_define, "^[0-9]+", namespaced_types},
{parse_transform, lager_transform}
]}.

{project_plugins, [
erlfmt,
rebar3_depup
]}.

{deps, [
{lager, "3.9.2"},
recon,
folsom,
{jsx, "3.0.0"},
{dns_erlang, ".*", {git, "https://github.com/dnsimple/dns_erlang.git", {branch, "main"}}},
iso8601,
{nodefinder, "2.0.0"},
{opentelemetry_api, "0.6.0"},
{meck, "0.9.2"}
]}.

{erl_opts,
[debug_info,
fail_on_warning,
{platform_define, "^[0-9]+", namespaced_types},
{parse_transform, lager_transform}]}.

{project_plugins, [erlfmt, rebar3_depup]}.

{deps,
[{lager, "3.9.2"},
recon,
folsom,
{jsx, "3.1.0"},
{dns_erlang,
".*",
{git,
"https://github.com/dnsimple/dns_erlang.git",
{branch, "main"}}},
iso8601,
{nodefinder, "2.0.7"},
{opentelemetry_api, "1.4.0"},
{meck, "0.9.2"}]}.
{profiles, [{test, [{deps, [proper]}]}]}.

{format, [
{formatter, default_formatter},
{files, [
"src/**/*.?rl", "include/**/*.?rl"
]},
{options, #{
paper => 160,
ribbon => 150,
inline_attributes => none,
inline_qualified_function_composition => true
}}
]}.

{format,
[{formatter, default_formatter},
{files, ["src/**/*.?rl", "include/**/*.?rl"]},
{options,
#{paper => 160, ribbon => 150,
inline_attributes => none,
inline_qualified_function_composition => true}}]}.
{depup, [{only, minor}]}.

{shell, [
{apps, [erldns]},
{config, "erldns.config"}
]}.

{relx, [
{release, {erldns, "3.0.0"}, [erldns]},

{dev_mode, true},
{include_erts, false},
{sys_config, "erldns.config"},
{overlay, [
{copy, "priv/zones-example.json", "priv/zones-example.json"},
{copy, "priv/zones-test.json", "priv/zones-test.json"}
]},

{extended_start_script, true}
]}.

%% This is a rebar3-ism
{overrides, [
{override, dns_erlang, [
{plugins, [
{provider_asn1, "0.2.3"}
]},
{provider_hooks, [
{pre, [
{compile, {asn, compile}}
]},
{post, [
{clean, {asn, clean}}
]}
]}
]}
]}.

{shell, [{apps, [erldns]}, {config, "erldns.config"}]}.

{relx,
[{release, {erldns, "3.0.0"}, [erldns]},
{dev_mode, true},
{include_erts, false},
{sys_config, "erldns.config"},
{overlay,
[{copy,
"priv/zones-example.json",
"priv/zones-example.json"},
{copy,
"priv/zones-test.json",
"priv/zones-test.json"}]},
{extended_start_script, true}]}.

{overrides,
[{override,
dns_erlang,
[{plugins, [{provider_asn1, "0.2.3"}]},
{provider_hooks,
[{pre, [{compile, {asn, compile}}]},
{post, [{clean, {asn, clean}}]}]}]}]}.
{dialyzer, [{warnings, [no_unknown]}]}.
{erlfmt, [write, {print_width, 140}]}.

{erlfmt, [
write,
{print_width, 140}
]}.
%% This is a rebar3-ism