-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added minor fixes for non wpe release. Added test script to output th…
…ese changes to make sure they work.
- Loading branch information
1 parent
2943748
commit ff3d554
Showing
3 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: 'Test Plugin Deploy' | ||
description: 'Upload zip file to releases tab' | ||
branding: | ||
icon: 'upload-cloud' | ||
color: 'blue' | ||
|
||
inputs: | ||
github_token: | ||
description: 'GitHub Token' | ||
required: true | ||
|
||
outputs: | ||
zip-path: | ||
description: 'Path to zip file' | ||
value: ${{ steps.zip-main-release-for-github.outputs.zip-path }} | ||
org-zip-path: | ||
description: 'Path to .org zip file' | ||
value: ${{ steps.zip-org-release-for-github.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-main-release-for-github | ||
name: Zip plugin for the main release | ||
run: | | ||
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 }}" | ||
echo "zip-path=$PWD/$zip_file" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- 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 '/## 1.6.0/,+4d' "dist/${{ env.SLUG }}/CHANGELOG.md" | ||
# Allow updates for .org | ||
sed -i -e '/\* Update URI: false/d' "dist/${{ env.SLUG }}/faustwp.php" | ||
# 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 "org-zip-path=$PWD/$org_zip_file" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- id: debug-org-changes | ||
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 }} | ||
cat "dist/${{ env.SLUG }}/CHANGELOG.md" | ||
cat "dist/${{ env.SLUG }}/faustwp.php" | ||
shell: bash |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Debug GitHub Actions Environment | ||
|
||
on: | ||
push: | ||
branches: | ||
- chore-minor-fixes-for-faustwp-non-wpe-release | ||
|
||
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/debug | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
env: | ||
PLUGIN_DIR: plugins/faustwp | ||
SLUG: faustwp | ||
VERSION: ${{ env.PLUGIN_VERSION }} |