mirror of
https://github.com/elementor/hello-theme.git
synced 2026-03-05 14:52:51 +08:00
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
build_plugin:
|
|
name: Build theme
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 18.x
|
|
- name: Cache node modules
|
|
uses: actions/cache@v4
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
${{ runner.os }}-build-
|
|
${{ runner.os }}-
|
|
- name: "Debug info: show tooling versions"
|
|
continue-on-error: true
|
|
run: |
|
|
set +e
|
|
echo "Start debug Info"
|
|
echo "Date: ${{ steps.date.outputs.date }}"
|
|
echo "PHP Version: $(php -v)"
|
|
echo "Composer Version: $(composer --version)"
|
|
echo "Node Version: $(node --version)"
|
|
echo "NPM Version: $(npm --version)"
|
|
echo "GIT Version: $(git --version)"
|
|
echo "The github context is:"
|
|
echo "${{ toJson(github) }}"
|
|
echo "The Theme version is:"
|
|
echo "${{ env.PACKAGE_VERSION }}"
|
|
echo "The Theme slug is:"
|
|
echo "hello-elementor"
|
|
echo "End debug Info"
|
|
echo "exitcode=$?" >> $GITHUB_OUTPUT
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
- name: Install Composer dependencies
|
|
run:
|
|
composer install --no-dev
|
|
- name: Build
|
|
run: npm run zip
|
|
- name: Upload zip file to GitHub actions artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: hello-elementor
|
|
path: hello-elementor.*.zip
|
|
retention-days: 7
|