Skip to content

Release

Release #2

Workflow file for this run

name: Release
on:
workflow_run:
workflows: [Test]
branches: [trunk]
types: [completed]
jobs:
check_and_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for version change
id: version_check
run: |
git diff origin/trunk..HEAD -- remote-data-blocks.php | grep -oP "Version: \K[^\s]+" > new_version.txt
if [ -s new_version.txt ]; then
NEW_VERSION=$(cat new_version.txt)
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "Version changed to: $NEW_VERSION"
else
echo "No version change detected"
fi
- name: Setup PHP
if: steps.version_check.outputs.new_version
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: Build plugin zip
if: steps.version_check.outputs.new_version
run: npm ci && npm run plugin-zip
- name: Create Release
if: steps.version_check.outputs.new_version
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version_check.outputs.new_version }}
files: remote-data-blocks.zip
generate_release_notes: true