Skip to content

chore(release): v2.4.12 #24

chore(release): v2.4.12

chore(release): v2.4.12 #24

Workflow file for this run

name: Release WordPress Plugin
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
build:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: mbstring, intl, curl
tools: composer, wp-cli
- name: Get the version
id: get_version
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
echo "VERSION=$VERSION" >> $GITHUB_ENV
case "$VERSION" in
*-alpha*|*-beta*|*-rc*|*-dev*|*-preview*)
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
;;
*)
echo "IS_PRERELEASE=false" >> $GITHUB_ENV
;;
esac
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install PHP dependencies
run: composer install
- name: Install Node dependencies
run: npm ci
- name: Verify version matches
run: |
WP_VERSION=$(grep -m 1 " \* Version:" ultimate-multisite.php | sed 's/.*Version:[[:space:]]*//')
README_VERSION=$(grep -m 1 "Stable tag: " readme.txt | awk -F' ' '{print $3}')
PKG_VERSION=$(node -p "require('./package.json').version")
echo "Tag version: ${{ env.VERSION }}"
echo "Plugin version: $WP_VERSION"
echo "readme.txt version: $README_VERSION"
echo "package.json version: $PKG_VERSION"
# For pre-releases, only check plugin header and package.json
# (readme.txt Stable tag stays at the last stable version)
if [ "${{ env.IS_PRERELEASE }}" = "true" ]; then
if [ "$WP_VERSION" != "${{ env.VERSION }}" ] || [ "$PKG_VERSION" != "${{ env.VERSION }}" ]; then
echo "Error: Version mismatch detected!"
exit 1
fi
echo "Pre-release version numbers match: ${{ env.VERSION }}"
else
if [ "$WP_VERSION" != "${{ env.VERSION }}" ] || [ "$README_VERSION" != "${{ env.VERSION }}" ] || [ "$PKG_VERSION" != "${{ env.VERSION }}" ]; then
echo "Error: Version mismatch detected!"
exit 1
fi
echo "All version numbers match: ${{ env.VERSION }}"
fi
- name: Run build process
run: npm run build
env:
MU_CLIENT_ID: ${{ secrets.MU_CLIENT_ID }}
MU_CLIENT_SECRET: ${{ secrets.MU_CLIENT_SECRET }}
- name: Rename archive for release
run: |
mkdir -p build
mv ultimate-multisite.zip build/ultimate-multisite-${{ env.VERSION }}.zip
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
build/ultimate-multisite-${{ env.VERSION }}.zip
name: Ultimate Multisite ${{ env.VERSION }}
draft: true
prerelease: ${{ env.IS_PRERELEASE == 'true' }}
body: |
# Ultimate Multisite ${{ env.VERSION }}
## What's Changed
For a complete list of changes, please refer to the [changelog](https://github.com/Multisite-Ultimate/ultimate-multisite/blob/main/readme.txt).
## Installation
1. Download the ZIP file from this release
2. Upload and activate the plugin in your WordPress Network installation
3. Follow the setup wizard to configure the plugin
## Notes
- Compatible with WordPress 5.3+
- Requires PHP 7.4.30+
- Always backup your site before upgrading