Merge branch 'fix-release' into 'master'

Fix release

See merge request framasoft/mobilizon!859
This commit is contained in:
Thomas Citharel 2021-03-16 10:39:28 +00:00
commit ad913eb131
2 changed files with 6 additions and 7 deletions

View file

@ -213,8 +213,8 @@ package-app:
- mix local.rebar --force - mix local.rebar --force
- mix deps.get - mix deps.get
- mix phx.digest - mix phx.digest
- mix release --path release - mix release --path release/mobilizon
- cd release && ln -s lib/mobilizon-*/priv priv - cd release/mobilizon && ln -s lib/mobilizon-*/priv priv
only: only:
- tags@framasoft/mobilizon - tags@framasoft/mobilizon
artifacts: artifacts:
@ -243,7 +243,7 @@ release-upload:
APP_ASSET="${CI_PROJECT_NAME}_${APP_VERSION}_${ARCH}.tar.gz" APP_ASSET="${CI_PROJECT_NAME}_${APP_VERSION}_${ARCH}.tar.gz"
echo "Artifact: ${APP_ASSET}" echo "Artifact: ${APP_ASSET}"
tar czf ${APP_ASSET} -C release . tar czf ${APP_ASSET} -C release mobilizon
ls -al ${APP_ASSET} ls -al ${APP_ASSET}
curl --silent --show-error --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "${APP_ASSET}" ${PACKAGE_REGISTRY_URL}/${APP_VERSION}/${APP_ASSET} curl --silent --show-error --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "${APP_ASSET}" ${PACKAGE_REGISTRY_URL}/${APP_VERSION}/${APP_ASSET}

View file

@ -7,13 +7,12 @@ defmodule Mobilizon.Web.Views.Utils do
import Mobilizon.Web.Gettext, only: [dgettext: 2] import Mobilizon.Web.Gettext, only: [dgettext: 2]
import Plug.Conn, only: [put_status: 2, halt: 1] import Plug.Conn, only: [put_status: 2, halt: 1]
@index_file_path Path.join(Application.app_dir(:mobilizon, "priv/static"), "index.html")
# sobelow_skip ["Traversal.FileModule"] # sobelow_skip ["Traversal.FileModule"]
@spec inject_tags(Enum.t(), String.t()) :: {:ok, {:safe, String.t()}} @spec inject_tags(Enum.t(), String.t()) :: {:ok, {:safe, String.t()}}
def inject_tags(tags, locale \\ "en") do def inject_tags(tags, locale \\ "en") do
with {:exists, true} <- {:exists, File.exists?(@index_file_path)}, with path <- Path.join(Application.app_dir(:mobilizon, "priv/static"), "index.html"),
{:ok, index_content} <- File.read(@index_file_path), {:exists, true} <- {:exists, File.exists?(path)},
{:ok, index_content} <- File.read(path),
safe <- do_replacements(index_content, MetadataUtils.stringify_tags(tags), locale) do safe <- do_replacements(index_content, MetadataUtils.stringify_tags(tags), locale) do
{:ok, {:safe, safe}} {:ok, {:safe, safe}}
else else