Merge branch 'master' into update-browserslist-db #1084
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
name: Build | |
on: [push, pull_request] | |
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 "${{ env.THEME_SLUG }}" | |
echo "End debug Info" | |
echo "exitcode=$?" >> $GITHUB_OUTPUT | |
- name: Install Dependencies | |
run: npm ci | |
- name: Install Composer dependencies | |
run: | |
composer install --no-dev | |
- name: Bump version on push to release or develop | |
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/develop') | |
run: | | |
npm config set git-tag-version false | |
if [ "${GITHUB_REF:11}" == "develop" ]; | |
then npm version patch | |
fi | |
if [[ "${GITHUB_REF:11:7}" == "release" ]]; | |
then npm version minor | |
fi | |
- 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 | |
retention-days: 7 |