Skip to content

Workflow test

Workflow test #2

Workflow file for this run

# .github/workflows/release.yml
name: AB Build Test for Sunflower 3.0 (on Push)
on:
push:
branches:
- sunflower2.0
env:
NODE_VERSION: 24
jobs:
build:
runs-on: ubuntu-latest
if: |
${{
startsWith(github.event.release.tag_name, 'v') &&
( contains(github.event.release.tag_name, '-alpha') ||
contains(github.event.release.tag_name, '-beta') ||
contains(github.event.release.tag_name, '-rc') )
}}
steps:
- uses: actions/checkout@v5
with:
path: sunflower26
- name: check theme version against tag
run: |
whoami
pwd
ls -l
cd $HOME
pwd
ls -l
THEME_VERSION=$(cat sass/style.scss | grep Version | sed -r 's/version: +//I')
V="v"
echo Version in style.scss: $THEME_VERSION
echo Tag name: ${{ github.event.release.tag_name }}
if [ "$V$THEME_VERSION" != "${{ github.event.release.tag_name }}" ]; then exit 1; fi
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node_modules directory
uses: actions/cache@v4
id: npm-cache-dir
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install npm packages
if: steps.npm-cache-dir.outputs.cache-hit != 'true'
run: npm ci
- name: Lint SCSS
run: npm run lint:scss
- name: Build CSS
run: npm run compile:css
- name: Build CSS-RTL
run: npm run compile:rtl
- name: Lint JS
run: npm run lint:js
- name: Build JS
run: npm run build
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: cs2pr
- name: run install composer
run: |
composer install
cd lib && composer install
- name: Run PHPCS checks
id: phpcs
continue-on-error: true
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml .
- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
run: cs2pr ./phpcs-report.xml
- name: Make bundle
run: npm run bundle
- name: fail on fork
if: github.repository_owner != 'verdigado'
run: exit 1
- name: Rename ZIP file
run: |
pwd
ls -l
mv ../sunflower26.zip sunflower-${{ github.event.release.tag_name }}.zip
ls -l