Commit a8267353 authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Resolve "Set up releases"

parent 9e398e3e
......@@ -105,3 +105,34 @@ mkdir -p $SOURCE_TOP/dist || exit 1
cp $SOURCE_TOP/.version \
$SOURCE_TOP/dist/version || exit 1
cp tarot-*.tar.gz $SOURCE_TOP/dist/ || exit 1
if test "x$CI_COMMIT_TAG" != "x"
then
cd $SOURCE_TOP
TARFILE=$(ls dist/tarot-*.tar.gz)
UPLOAD_STATUS=$(curl \
--request POST \
--header "PRIVATE-TOKEN: $PRIVATE_TOKEN" \
--form \
"file=@$TARFILE" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/uploads")
URL=$(echo "$UPLOAD_STATUS" | jq -r '.url')
echo "Upload $TARFILE to $CI_API_V4_URL/projects/$CI_PROJECT_ID/uploads: $UPLOAD_STATUS"
NAME="Tarot release"
TAG_NAME="$CI_COMMIT_TAG"
DESCRIPTION=$(git tag -l --format='%(contents)' "$CI_COMMIT_TAG")
FULL_URL="${CI_PROJECT_URL}${URL}"
LINK="{\"name\": \"$TARFILE\", \"url\": \"$FULL_URL\"}"
ASSETS="{\"links\": [$LINK]}"
DESCRIPTION_ESCAPED=$(echo "$DESCRIPTION" | jq -R --slurp '.')
DATA="{\"name\": \"$NAME\", \"tag_name\": \"$TAG_NAME\", \"description\": $DESCRIPTION_ESCAPED, \"assets\": $ASSETS}"
echo "POSTing $DATA to $CI_API_V4_URL/projects/$CI_PROJECT_ID/releases"
curl --header 'Content-Type: application/json' \
--header "PRIVATE-TOKEN: $PRIVATE_TOKEN" \
--data "$DATA" \
--request POST \
"$CI_API_V4_URL/projects/$CI_PROJECT_ID/releases"
fi
......@@ -42,7 +42,10 @@ $(srcdir)/%reldir%/tarot/mcts_tree_private.h: %reldir%/../tree/gentree-header.tp
$(srcdir)/%reldir%/tarot/mcts_tree_private_impl.h: %reldir%/../tree/gentree-code.tpl %reldir%/node-tree.def
$(AM_V_GEN) $(AUTOGEN) -T $(srcdir)/%reldir%/../tree/gentree-code.tpl $(srcdir)/%reldir%/node-tree.def > $(srcdir)/%reldir%/tarot/mcts_tree_private_impl.h
$(srcdir)/%reldir%/tarot/mcts_private_impl.h: %reldir%/tarot/mcts_tree_private.h %reldir%/tarot/mcts_tree_private_impl.h
$(srcdir)/%reldir%/tarot/mcts_private_impl.h: \
%reldir%/tarot/mcts_tree_private.h \
%reldir%/tarot/mcts_tree_private_impl.h \
src/cards/tarot/cards.h
$(srcdir)/src/Tarot-@LIBTOOL_CURRENT@.0.gir: %reldir%/tarot/mcts_private_impl.h
EXTRA_DIST += \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment