Create package #3
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
name: Create package | |
on: | |
workflow_dispatch: | |
inputs: | |
PACKAGE_VERSION: | |
description: 'Package Version' | |
required: true | |
jobs: | |
tag: | |
name: New package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- uses: php-actions/composer@v6 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Install npm dependencies | |
run: npm install | |
- name: Build assets with wp-scripts | |
run: npm run build | |
- name: Exclude files listed in .distignore | |
run: | | |
if [ -f .distignore ]; then | |
mkdir filtered | |
rsync -av --exclude-from='.distignore' . ./filtered | |
fi | |
- name: Create zip archive | |
run: | | |
cd filtered | |
zip -r ../package-${{ github.event.inputs.PACKAGE_VERSION }}.zip . | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: monei-${{ github.event.inputs.PACKAGE_VERSION }} | |
path: monei-${{ github.event.inputs.PACKAGE_VERSION }}.zip | |