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
55 changes: 45 additions & 10 deletions .github/actions/release-plugin/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Plugin Deploy'
name: 'Test Plugin Deploy'
description: 'Upload zip file to releases tab'
branding:
icon: 'upload-cloud'
Expand All @@ -8,6 +8,9 @@ outputs:
zip-path:
description: 'Path to zip file'
value: ${{ steps.zip.outputs.zip-path }}
org-zip-path:
description: 'Path to .org zip file'
value: ${{ steps.zip-org.outputs.zip-path }}

runs:
using: 'composite'
Expand All @@ -16,26 +19,58 @@ runs:
name: Prepare Environment
run: |
sudo apt-get update && sudo apt-get install zip rsync -y
- id: zip
name: Zip Plugin (optional)
shell: bash

- id: zip-main-release-for-github
name: Zip plugin for the main release
run: |
# Create dist folder and copy files while excluding .distignore items
mkdir -p dist
rsync -av --exclude-from="${{ env.PLUGIN_DIR }}/.distignore" ${{ env.PLUGIN_DIR }}/ dist/${{ env.SLUG }}

# Zip the plugin directory
zip_file="faustwp-${{ env.VERSION }}.zip"
zip -r $zip_file dist/${{ env.SLUG }}
zip -r "$zip_file" "dist/${{ env.SLUG }}"

# Save zip path to output
echo "::set-output name=zip-path::$PWD/$zip_file"
shell: bash

- id: upload
name: Upload Zip File to Release
- id: zip-org-release-for-github
name: Zip plugin for the non wpe-updater release
run: |
# Delete old directory
rm -rf dist

# Create dist folder and copy files while excluding .distignore items
mkdir -p dist
# Copy plugin files to dist folder and exclude external updater
rsync -av --exclude-from="${{ env.PLUGIN_DIR }}/.distignore" --exclude="includes/updates/check-for-updates.php" --exclude="includes/updates/class-plugin-updater.php" "${{ env.PLUGIN_DIR }}/" "dist/${{ env.SLUG }}"

# Updates for the CHANGELOG file
sed -i -e 's/plugin updates from an external API endpoint./plugin updates from an external API endpoint when not installed from WordPress.org/' "dist/${{ env.SLUG }}/CHANGELOG.md"

# Create .org zip file
org_zip_file="faustwp-${{ env.VERSION }}.org.zip"
zip -r "$org_zip_file" "dist/${{ env.SLUG }}"

# Save zip path to output
echo "::set-output name=zip-path::$PWD/$org_zip_file"
shell: bash

- id: upload-main-release-to-github
name: Uploads the main release zip file to Github
uses: softprops/action-gh-release@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ steps.zip.outputs.zip-path }}
asset_name: faustwp-${{ env.VERSION }}.zip
overwrite: true

- id: upload-org-release-to-github
name: Uploads the non wpe-updater release zip file to Github
uses: softprops/action-gh-release@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ steps.zip.outputs.zip-path }} # Updated to use zip-path output
asset_name: faustwp-${{ env.VERSION }}.zip # Set asset name to the correct versioned name
overwrite: true
files: ${{ steps.zip-org.outputs.zip-path }}
asset_name: faustwp-${{ env.VERSION }}.org.zip
overwrite: true
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
wordpress: [ '6.7', '6.6', '6.5', '6.4', '6.3', '6.2', '6.1' ]
wordpress: [ '6.7', '6.6', '6.5', '6.4', '6.3', '6.2']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
10 changes: 8 additions & 2 deletions plugins/faustwp/faustwp.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,14 @@ function () {
return;
}

require FAUSTWP_DIR . '/includes/updates/class-plugin-updater.php';
require FAUSTWP_DIR . '/includes/updates/check-for-updates.php';
// Loads the updater service, if included in this build.
if ( file_exists( FAUSTWP_DIR . '/includes/updates/class-plugin-updater.php' ) ) {
require FAUSTWP_DIR . '/includes/updates/class-plugin-updater.php';
}
if ( file_exists( FAUSTWP_DIR . '/includes/updates/check-for-updates.php' ) ) {
require FAUSTWP_DIR . '/includes/updates/check-for-updates.php';
}

require FAUSTWP_DIR . '/includes/auth/functions.php';
require FAUSTWP_DIR . '/includes/telemetry/functions.php';
require FAUSTWP_DIR . '/includes/replacement/functions.php';
Expand Down
Loading