Bulk discounts custom attributes #263
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Actions Workflow for deploying the testing plugin zip to Slack | |
name: Deploy Testing Plugin Zip to Slack | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
notify-slack-channel: | |
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup PHP 8.0 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.0 | |
tools: composer | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '21' | |
- name: Install dependencies | |
run: composer install --no-dev --ignore-platform-reqs --prefer-dist --no-scripts --optimize-autoloader | |
- name: Install nodejs dependencies | |
run: npm install | |
- name: Generate production build | |
run: npm run production | |
- name: Generate translation files | |
run: npm run translate | |
- name: Clean unneeded files | |
run: | | |
[ -f .gitattributes ] && rm .gitattributes | |
[ -d .github ] && rm -r .github | |
[ -d .git ] && rm -r .git | |
[ -f .gitignore ] && rm .gitignore | |
[ -f phpcs.xml ] && rm phpcs.xml | |
[ -f wpgulp.config.js ] && rm wpgulp.config.js | |
[ -f gulpfile.babel.js ] && rm gulpfile.babel.js | |
[ -f composer.json ] && rm composer.json | |
[ -f composer.lock ] && rm composer.lock | |
[ -f package.json ] && rm package.json | |
[ -f readme.md ] && rm readme.md | |
[ -d assets/sass ] && rm -r assets/sass | |
[ -d assets/js/src ] && rm -r assets/js/src | |
[ -d node_modules ] && rm -r node_modules | |
- name: Create directory for artifacts | |
run: mkdir merchant | |
- name: Move files to merchant directory | |
run: rsync -av --progress --exclude=merchant . merchant/ | |
- name: Create Artifact | |
run: zip -qq -r "merchant.zip" merchant/ | |
- name: Upload file to Slack | |
run: > | |
curl -F [email protected] | |
-F "initial_comment=🎉 Hey Team! | |
A new testing version of *Merchant Free* has been written by *${{ github.actor }}* in <https://github.com/${{ github.repository }}|${{ github.repository }}>. | |
*Here's what's included:* :rocket: | |
${{ github.event.pull_request.body }} | |
_Dive deeper into the changes: ${{ github.event.pull_request.html_url }} _" | |
-F channels=${{ secrets.SLACK_CHANNEL_ID }} | |
-H "Authorization: Bearer ${{ secrets.SLACK_BOT_TOKEN }}" | |
https://slack.com/api/files.upload |