Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 13 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release

on:
push:
branches:
- main
tags:
- 'v*'

permissions:
contents: write
Expand All @@ -14,42 +14,28 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Get plugin version
- name: Get version from tag
id: version
run: |
VERSION=$(grep -oP "Version:\s*\K[0-9.]+" 84em-gravity-forms-ai.php)
VERSION=${GITHUB_REF_NAME#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT

- name: Check if release exists
id: check
run: |
if gh release view "v${{ steps.version.outputs.version }}" > /dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Build zip
if: steps.check.outputs.exists == 'false'
run: |
mkdir -p build
zip -r build/84em-gravity-forms-ai-${{ steps.version.outputs.version }}.zip . \
-x "*.git*" -x "node_modules/*" -x "vendor/*" -x "tests/*" \
-x "*.zip" -x "coverage-report/*" -x ".phpcs*" -x "phpunit*" \
-x "build/*"
cp build/84em-gravity-forms-ai-${{ steps.version.outputs.version }}.zip build/84em-gravity-forms-ai.zip
- name: Build plugin
run: ./build.sh

- name: Create release
if: steps.check.outputs.exists == 'false'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
files: |
build/84em-gravity-forms-ai-${{ steps.version.outputs.version }}.zip
build/84em-gravity-forms-ai.zip
84em-gravity-forms-ai-${{ steps.version.outputs.version }}.zip
84em-gravity-forms-ai.zip

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release workflow uses Node.js 20 while the deploy-plugin workflow uses Node.js 22. For consistency and to ensure identical build outputs across different workflows, consider using the same Node.js version in both workflows. This helps prevent subtle differences in build artifacts between deployments and releases.

Copilot uses AI. Check for mistakes.
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated test count to 135+

### Fixed
- Removed workflow_dispatch from security-review.yml (only works on PRs)
- Removed workflow_dispatch from security-review.yml (not needed for PR-only workflow)

### Removed
- Project structure section from README
Expand Down