Skip to content

v7.0.2

v7.0.2 #3

name: Release and publish
on:
release:
types: [released, prereleased]
env:
PHP_BUILDER_VERSION: "8.3"
NODE_BUILDER_VERSION: "20"
DOCKER_COMPOSE_VERSION: v2.27.0
GITHUB_TOKEN: ${{ secrets.GA_ACCESS_TOKEN }}
VERSION: ${{ github.event.release.tag_name }}
jobs:
e2e_tests:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event.release.tag_name != 'staging'
strategy:
matrix:
ps_version: ["1.7.8.10", "8.1.7"]
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Cache vendor folder
uses: actions/cache@v3
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
- name: Install docker compose
run: |
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
rm -f $DOCKER_CONFIG/cli-plugins/docker-compose
curl -SL https://github.com/docker/compose/releases/download/${{ env.DOCKER_COMPOSE_VERSION }}/docker-compose-linux-x86_64 \
-o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
- name: Setup e2e-env with Prestashop ${{ matrix.ps_version }}
run: |
cp .env.dist .env
docker compose build
docker compose up --detach --wait
env:
DOCKER_IMAGE_PRESTASHOP: prestashop/prestashop-flashlight:${{matrix.ps_version}}
working-directory: e2e-env
# - name: Run e2e:tests with Prestashop ${{ matrix.ps_version }}
# run: pnpm test:e2e
# working-directory: e2e
- name: More logs on failure
if: failure()
run: |
docker compose logs prestashop
docker compose down -v
working-directory: e2e-env
upload_release_assets:
name: Upload zip assets to the release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_BUILDER_VERSION }}
- name: Bundle zip
run: make zip
env:
VERSION: ${{ github.event.release.tag_name }}
- name: Get short commit sha
id: commit
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Upload the zip assets
uses: softprops/action-gh-release@v2
with:
files: |
./dist/${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.zip
./dist/${{ github.event.repository.name }}.zip
./dist/ps_accounts.zip
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.event.release.tag_name == 'staging' && format('🐣 staging (commit {0})', steps.commit.outputs.sha) || github.event.release.tag_name }}
notify_earth:
name: Notify slack internal channels about the release
needs:
- upload_release_assets
- e2e_tests
if: success()
runs-on: ubuntu-latest
steps:
- uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: 8FCE00
SLACK_TITLE: "🚀 PS Accounts Mock ${{ github.event.release.tag_name }} has been released"
SLACK_MESSAGE: ${{ github.event.release.body }}
SLACK_FOOTER: "https://github.com/PrestaShopCorp/ps_eventbus/releases/tag/${{ github.event.release.tag_name }}"
SLACK_USERNAME: QABot
SLACK_CHANNEL: squad-cloudsync
SLACK_ICON: https://raw.githubusercontent.com/PrestaShopCorp/ps_eventbus/main/logo.png