Release #2
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: 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 |