Skip to content

v2.9.30-beta.1

v2.9.30-beta.1 #103

name: Run CS fixer & deploy
on: [push]
jobs:
check:
runs-on: ubuntu-20.04
name: Code style check
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
- name: Code Style
run: |
curl -L https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v3.50.0/php-cs-fixer.phar -o php-cs-fixer
chmod a+x php-cs-fixer
./php-cs-fixer fix --config=.php-cs-fixer.dist.php --cache-file=.php-cs.cache --diff --dry-run --verbose
deploy:
name: Deploy to GitHub
needs: [check]
runs-on: ubuntu-20.04
if: startsWith(github.ref, 'refs/tags/') # only tags
steps:
- name: Get tag name
id: set-tag
run: echo "TAG_NAME=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
- name: Check out repository code
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
- name: Build ZIP
run: ./release/build_release_package.sh
env:
TAG_NAME: ${{ steps.set-tag.outputs.TAG_NAME }}
- name: Create GitHub release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.set-tag.outputs.TAG_NAME }}
name: Shopgate Cart Integration Magento 2 Export ${{ steps.set-tag.outputs.TAG_NAME }}
draft: true
prerelease: true
fail_on_unmatched_files: true
files: ./release/shopgate-export-${{ steps.set-tag.outputs.TAG_NAME }}.zip
notify-release-success:
name: Notify developers of new release
needs: [deploy]
runs-on: ubuntu-20.04
if: |
success() &&
startsWith(github.ref, 'refs/tags/')
steps:
- name: Get tag name
id: set-tag
run: echo "TAG_NAME=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
- name: Notify on Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_MERCHANT_UNIT }}
SLACK_USERNAME: 'GitHub Actions'
SLACK_ICON_EMOJI: ':octocat:'
SLACK_TITLE: New release for ${{ github.repository }}
SLACK_MESSAGE: Released version ${{ steps.set-tag.outputs.TAG_NAME }} of ${{ github.repository }}
notify-release-fail:
name: Notify developers of failed release
needs: [deploy]
runs-on: ubuntu-20.04
if: |
failure() &&
startsWith(github.ref, 'refs/tags/')
steps:
- name: Get tag name
id: set-tag
run: echo "TAG_NAME=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
- name: Notify on Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_MERCHANT_UNIT }}
SLACK_USERNAME: 'GitHub Actions'
SLACK_ICON_EMOJI: ':octocat:'
SLACK_COLOR: '#A30200'
SLACK_TITLE: Release failed for ${{ github.repository }}
SLACK_MESSAGE: Release failed for version ${{ steps.set-tag.outputs.TAG_NAME }} of ${{ github.repository }}