From fbe0d92c7413625c5312df5908b1b3fffe35fa78 Mon Sep 17 00:00:00 2001 From: Adam BRECHET Date: Thu, 6 Mar 2025 14:55:53 +0100 Subject: [PATCH] Bump version 2.25.1 --- .github/workflows/slack-message.yml | 95 ++---------------- .gitlab-ci.yml | 112 +--------------------- CHANGELOG.md | 2 +- src/hipay_enterprise/composer.json | 2 +- src/hipay_enterprise/hipay_enterprise.php | 2 +- 5 files changed, 16 insertions(+), 197 deletions(-) diff --git a/.github/workflows/slack-message.yml b/.github/workflows/slack-message.yml index 6173faff..5cc0547e 100644 --- a/.github/workflows/slack-message.yml +++ b/.github/workflows/slack-message.yml @@ -27,90 +27,11 @@ jobs: env: EVENT_CONTEXT: ${{ toJSON(github.event) }} CONVERTED_TEXT: ${{ steps.convert.outputs.text }} - run: | - node < { - const project = "HiPay Enterprise SDK Prestashop"; - const payload = { - channel: "${{ vars.SLACK_CHANNEL_ID }}", - blocks: [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "*[NEW]* " + project + " - ${{ github.event.release.tag_name }}", - }, - "accessory": { - "type": "button", - "text": { - "type": "plain_text", - "text": "Show release :rocket:", - "emoji": true - }, - "url": "${{ github.event.release.html_url }}" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ":clipboard: Tickets JIRA :" - } - }, - { - "type": "rich_text", - "elements": [ - { - "type": "rich_text_list", - "style": "bullet", - "elements": [] - } - ] - } - ] - }; - - if(tickets.length) { - tickets.forEach((ticket) => { - ticket = ticket.toUpperCase(); - payload.blocks[2].elements[0].elements.push({ - "type": "rich_text_section", - "elements": [ - { - "type": "link", - "url": "https://${{ vars.JIRA_DOMAIN }}/browse/" + ticket, - "text": ticket - } - ] - }); - }); - } else { - payload.blocks.splice(2, 1); - payload.blocks.splice(1, 1); - } - - console.log("payload", payload); - - try { - const slackResponse = await fetch("https://slack.com/api/chat.postMessage", { - method: "POST", - headers: { - "Authorization": "Bearer ${{ secrets.SLACK_API_TOKEN }}", - "Content-Type": "application/json" - }, - body: JSON.stringify(payload) - }); - - if (!slackResponse.ok) { - const err = await slackResponse.json(); - throw new Error("Failed to send message: " + JSON.stringify(err)); - } - - console.log("Message sent successfully !"); - } catch (error) { - console.error("Request error", error.message); - } - })(); - EOF + GITHUB_PROJECT_NAME: 'HiPay Enterprise SDK Prestashop' + GITHUB_RELEASE_TAG: ${{ github.event.release.tag_name }} + GITHUB_RELEASE_URL: ${{ github.event.release.html_url }} + JIRA_DOMAIN: ${{ vars.JIRA_DOMAIN }} + SLACK_CHANNEL_ID: ${{ vars.SLACK_CHANNEL_ID }} + SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }} + run: |- + curl -s https://raw.githubusercontent.com/hipay/common-workflows/main/scripts/slack-message.js | node diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac04bed5..a8829b71 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,5 @@ image: $REGISTRY_CI/gitlab-ci-base:buster -workflow: - rules: - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: never - - when: always - stages: - build-test - test @@ -17,6 +11,11 @@ stages: variables: GIT_DEPTH: 10 +include: + - project: 'pi-ecommerce/cms/cms-template-ci' + ref: '1.0.0' + file: 'release.yaml' + ######################### #### TEMPLATE #### ######################## @@ -252,107 +251,6 @@ package: when: never - when: on_success -# Job to get JIRA tickets of the release -get-jira-tickets: - stage: release - image: node:latest - rules: - - if: $ONLY_DEPLOY - when: never - - if: $CI_COMMIT_TAG - script: - - | - node < { - try { - const gitlabResponse = await fetch("${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/merge_requests?state=merged&target_branch=develop&milestone=${CI_COMMIT_TAG}", { - method: "GET", - headers: { - "Private-Token": "$GITLAB_API_TOKEN" - } - }); - - if (!gitlabResponse.ok) { - const err = await gitlabResponse.json(); - throw new Error("Failed to send GitLab request: " + JSON.stringify(err)); - } - - const mergeRequests = await gitlabResponse.json(); - let tickets = []; - - mergeRequests.forEach((mr) => { - const matches = mr.source_branch.match(/EC-\d+/); - if(matches?.length) { - tickets.push(matches[0].toUpperCase()); - } - }); - - tickets = [...new Set(tickets)]; - - console.log("tickets", tickets); - - const payload = { - "event_type": "trigger-artifact-workflow", - "client_payload": { - "tickets": tickets - } - }; - - console.log("payload", JSON.stringify(payload)); - - const githubResponse = await fetch("https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_PROJECT}/dispatches", { - method: "POST", - headers: { - "Content-Type": "application/json", - "Authorization": "Bearer ${GITHUB_TOKEN}", - "User-Agent": "Node.js" - }, - body: JSON.stringify(payload) - }); - - if (!githubResponse.ok) { - const err = await githubResponse.json(); - throw new Error("Failed to send GitHub event: " + JSON.stringify(err)); - } - } catch (error) { - throw new Error("Request error: " + error.message); - } - })(); - EOF - -# Release note job -release-job: - stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest - needs: - - get-jira-tickets - variables: - TEMP_CHANGELOG_FILE: 'release_changelog.txt' - rules: - - if: $ONLY_DEPLOY - when: never - - if: $CI_COMMIT_TAG - script: - - | - # Extract changelog part according to tag version - CHANGELOG=$(awk -v version="## $CI_COMMIT_TAG" ' - $0 ~ version {printit=1; next} - printit && /^## / {exit} - printit {print} - ' CHANGELOG.md) - - { - echo "# CHANGE LOG" - echo "$CHANGELOG" - } > "$TEMP_CHANGELOG_FILE" - - cat "$TEMP_CHANGELOG_FILE" - release: - tag_name: $CI_COMMIT_TAG - name: Version $CI_COMMIT_TAG - description: '$TEMP_CHANGELOG_FILE' - milestones: - - $CI_COMMIT_TAG - build-prestashop16: variables: PS_VERSION: 16 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0361ae4d..55d7dbfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## UNRELEASED +## 2.25.1 - **Fix** : Remove "file_get_contents" for external URLs - **Fix** : Fixed upgrade script from previous version `2.25.0`, thanks to [geoffrey-bedle](https://github.com/geoffrey-bedle) for issue [#90](https://github.com/hipay/hipay-enterprise-sdk-prestashop/issues/90) diff --git a/src/hipay_enterprise/composer.json b/src/hipay_enterprise/composer.json index 75c9f715..ec578a19 100755 --- a/src/hipay_enterprise/composer.json +++ b/src/hipay_enterprise/composer.json @@ -17,5 +17,5 @@ "hipay/hipay-fullservice-sdk-php": "^2.19.1", "symfony/polyfill-php80": "<=1.18.1" }, - "version": "2.25.0" + "version": "2.25.1" } diff --git a/src/hipay_enterprise/hipay_enterprise.php b/src/hipay_enterprise/hipay_enterprise.php index 31e72f16..01a0ef92 100755 --- a/src/hipay_enterprise/hipay_enterprise.php +++ b/src/hipay_enterprise/hipay_enterprise.php @@ -41,7 +41,7 @@ public function __construct() { $this->name = 'hipay_enterprise'; $this->tab = 'payments_gateways'; - $this->version = '2.25.0'; + $this->version = '2.25.1'; $this->module_key = 'c3c030302335d08603e8669a5210c744'; $this->ps_versions_compliancy = ['min' => '1.7.6', 'max' => _PS_VERSION_]; $this->currencies = true;