diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bae8cd7..164686f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -100,10 +100,23 @@ pages: - find framadate/ -type d -exec chmod 750 {} \; - find framadate/ -type f -exec chmod 640 {} \; - rm -rf framadate/.git - - zip -r latest.zip framadate + - export RELEASE_ZIP="framadate-${CI_COMMIT_TAG}.zip" + - zip -r $RELEASE_ZIP framadate - mkdir .public - - cp latest.zip .public + - cp $RELEASE_ZIP .public/latest.zip - mv .public public + - if [[ -z $GITLAB_API_TOKEN ]]; then exit; fi + - export PROJECT_API_URL="https://framagit.org/api/v4/projects/${CI_PROJECT_ID}" + - export DESCRIPTION_URL="${PROJECT_API_URL}/repository/tags/${CI_COMMIT_TAG}" + - export RELEASE_URL="${DESCRIPTION_URL}/release" + - 'export HEADER="Private-Token: ${GITLAB_API_TOKEN}"' + - export artifactUrl=$(curl -s --request POST --header "${HEADER}" --form "file=@${RELEASE_ZIP}" "${PROJECT_API_URL}/uploads" | jq -r .url) + - export artifactAbsoluteUrl="${CI_PROJECT_URL}${artifactUrl}" + - export description=$(curl -s --header "${HEADER}" "${DESCRIPTION_URL}" | jq .release.description | sed -e 's@"@@g') + - if [[ $description == 'null' ]]; then export METHOD="POST"; echo -e 'You can download the release zip here:'" [${RELEASE_ZIP}](${artifactAbsoluteUrl})" > /tmp/text; fi + - if [[ $description != 'null' ]]; then export METHOD="PUT"; echo -e "${description}\n\n"'You can download the release zip here:'" [${RELEASE_ZIP}](${artifactAbsoluteUrl})" > /tmp/text; fi + - curl -s --request $METHOD --data-urlencode "description@/tmp/text" --header "${HEADER}" "${RELEASE_URL}" + - curl -s --request POST --header "${HEADER}" --data name="${RELEASE_ZIP}" --data url="${artifactAbsoluteUrl}" "${PROJECT_API_URL}/releases/${CI_COMMIT_TAG}/assets/links" artifacts: paths: - public diff --git a/app/classes/Framadate/Services/AdminPollService.php b/app/classes/Framadate/Services/AdminPollService.php index f3d00fd..de8a659 100644 --- a/app/classes/Framadate/Services/AdminPollService.php +++ b/app/classes/Framadate/Services/AdminPollService.php @@ -325,7 +325,7 @@ class AdminPollService { // Search where to insert new column foreach ($slots as $k=>$slot) { - $rowDatetime = $slot->title; + $rowDatetime = (int) $slot->title; $moments = explode(',', $slot->moments); if ($datetime === $rowDatetime) { diff --git a/app/inc/constants.php b/app/inc/constants.php index a0f0e02..25f0c45 100644 --- a/app/inc/constants.php +++ b/app/inc/constants.php @@ -19,7 +19,6 @@ // FRAMADATE version const VERSION = '1.2.0-alpha.1'; - // PHP Needed version const PHP_NEEDED_VERSION = '5.6';