Skip to content

Commit

Permalink
Merge pull request #7 from bonfire-networks/update_boilerplate
Browse files Browse the repository at this point in the history
Update boilerplate to latest version.
  • Loading branch information
mayel authored Nov 7, 2024
2 parents 529f60e + 8b9a65e commit 7d825e4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ on:
permissions:
contents: read

# Stop previous jobs if they are still running.
# https://docs.github.com/en/actions/learn-github-actions/expressions
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
concurrency:
# Use github.run_id on main branch
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
# Use github.ref on other branches, so it's unique per branch
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:

Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.hex
.mix
assets/node_modules
assets/*.log
priv/cldr

# If you run "mix test --cover", coverage assets end up here.
Expand All @@ -25,7 +26,9 @@ erl_crash.dump
*.ez

# Ignore package tarball (built via "mix hex.build").
bonfire_web_phoenix-*.tar
bonfire_*-*.tar

# ignore local mess deps
deps.path

/data
26 changes: 20 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,34 @@ clean-symlinks:
find lib/ -type l -delete

boilerplate-update:
mkdir -p .bonfire-extension-boilerplate
mkdir -p .bonfire-extension-boilerplate .github/workflows
git clone https://github.com/bonfire-networks/bonfire-extension-boilerplate.git --branch main --single-branch .bonfire-extension-boilerplate
cd .bonfire-extension-boilerplate && cp .envrc justfile .gitignore .. && cp .github/workflows/main.yml ../.github/workflows/main.yml && cp lib/mix/mess.ex ../mess.exs
rm -rf .bonfire-extension-boilerplate

deps-get:
mix deps.get

deps-update:
mix deps.update --all
deps-update +FLAGS='--all':
mix deps.update {{FLAGS}}

common-mix-tasks-setup:
cd lib/mix/ && ([ -d ../../deps/bonfire_common/lib/mix_tasks ] && ln -sf ../../deps/bonfire_common/lib/mix_tasks tasks || ln -sf ../mix_tasks tasks) && cd -
cd lib/mix/tasks/release/ && MIX_ENV=prod mix escript.build && cd -
@common-mix-tasks-setup:
#!/usr/bin/env bash
set -eu
mkdir -p lib/mix

cd lib/mix

if [ -d ../../deps/bonfire_common/lib/mix_tasks ]; then
ln -sf ../../deps/bonfire_common/lib/mix_tasks tasks
else
ln -sf ../mix_tasks tasks
fi

cd tasks/release

MIX_ENV=prod mix escript.build

ext-migrations-copy: common-mix-tasks-setup
mkdir -p priv/repo
Expand Down

0 comments on commit 7d825e4

Please sign in to comment.