Skip to content
Closed
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
92 changes: 92 additions & 0 deletions .github/actions/test-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: 'Test Plugin Deploy'
description: 'Upload zip file to releases tab'
branding:
icon: 'upload-cloud'
color: 'blue'

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'
steps:
- id: prepare
name: Prepare Environment
run: |
sudo apt-get update && sudo apt-get install zip rsync -y
shell: bash

- id: zip
name: Zip Plugin (Main)
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_file="faustwp-${{ env.VERSION }}.zip"
zip -r "$zip_file" "dist/${{ env.SLUG }}"

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

- id: zip-org
name: Zip Plugin (.org version)
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" "${{ 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: debug-main
name: Debug Check Main Zip File
run: |
echo "Main zip file path: ${{ steps.zip.outputs.zip-path }}"
ls -lah ${{ steps.zip.outputs.zip-path }}
unzip -l ${{ steps.zip.outputs.zip-path }}
shell: bash

- id: debug-org
name: Debug Check .org Zip File
run: |
echo ".org zip file path: ${{ steps.zip-org.outputs.zip-path }}"
ls -lah ${{ steps.zip-org.outputs.zip-path }}
unzip -l ${{ steps.zip-org.outputs.zip-path }}
shell: bash

# - id: upload-main
# name: Upload Main Zip File to Release
# 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
# name: Upload .org Zip File to Release
# uses: softprops/action-gh-release@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# files: ${{ steps.zip-org.outputs.zip-path }}
# asset_name: faustwp-${{ env.VERSION }}.org.zip
# overwrite: true
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test Release Packages

on:
push:
branches:
- chore-update-faustwp-release-process

jobs:
release_packages:
name: Release Packages
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Ensure full Git history

- name: Set Plugin Version (Fallback)
run: echo "PLUGIN_VERSION=1.0.0-test" >> $GITHUB_ENV

- name: Deploy WordPress Plugin
uses: ./.github/actions/test-release
env:
PLUGIN_DIR: plugins/faustwp
SLUG: faustwp
VERSION: ${{ env.PLUGIN_VERSION }}
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