diff --git a/.github/actions/release-plugin/action.yml b/.github/actions/release-plugin/action.yml index 4bb0fd7c3..54dd938bf 100644 --- a/.github/actions/release-plugin/action.yml +++ b/.github/actions/release-plugin/action.yml @@ -1,4 +1,4 @@ -name: 'Plugin Deploy' +name: 'Test Plugin Deploy' description: 'Upload zip file to releases tab' branding: icon: 'upload-cloud' @@ -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' @@ -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 \ No newline at end of file + files: ${{ steps.zip-org.outputs.zip-path }} + asset_name: faustwp-${{ env.VERSION }}.org.zip + overwrite: true diff --git a/.github/workflows/unit-test-plugin.yml b/.github/workflows/unit-test-plugin.yml index 489e293f8..b3803123b 100644 --- a/.github/workflows/unit-test-plugin.yml +++ b/.github/workflows/unit-test-plugin.yml @@ -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 diff --git a/plugins/faustwp/faustwp.php b/plugins/faustwp/faustwp.php index adeec79c8..85901eef9 100644 --- a/plugins/faustwp/faustwp.php +++ b/plugins/faustwp/faustwp.php @@ -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';