Skip to content

Commit ff3d554

Browse files
committed
Added minor fixes for non wpe release. Added test script to output these changes to make sure they work.
1 parent 2943748 commit ff3d554

File tree

3 files changed

+104
-1
lines changed

3 files changed

+104
-1
lines changed

.github/actions/debug/action.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: 'Test Plugin Deploy'
2+
description: 'Upload zip file to releases tab'
3+
branding:
4+
icon: 'upload-cloud'
5+
color: 'blue'
6+
7+
inputs:
8+
github_token:
9+
description: 'GitHub Token'
10+
required: true
11+
12+
outputs:
13+
zip-path:
14+
description: 'Path to zip file'
15+
value: ${{ steps.zip-main-release-for-github.outputs.zip-path }}
16+
org-zip-path:
17+
description: 'Path to .org zip file'
18+
value: ${{ steps.zip-org-release-for-github.outputs.zip-path }}
19+
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- id: prepare
24+
name: Prepare Environment
25+
run: sudo apt-get update && sudo apt-get install zip rsync -y
26+
shell: bash
27+
28+
- id: zip-main-release-for-github
29+
name: Zip plugin for the main release
30+
run: |
31+
mkdir -p dist
32+
rsync -av --exclude-from="${{ env.PLUGIN_DIR }}/.distignore" ${{ env.PLUGIN_DIR }}/ dist/${{ env.SLUG }}
33+
34+
zip_file="faustwp-${{ env.VERSION }}.zip"
35+
zip -r "$zip_file" "dist/${{ env.SLUG }}"
36+
37+
echo "zip-path=$PWD/$zip_file" >> $GITHUB_ENV
38+
shell: bash
39+
40+
- id: zip-org-release-for-github
41+
name: Zip plugin for the non wpe-updater release
42+
run: |
43+
# Delete old directory
44+
rm -rf dist
45+
# Create dist folder and copy files while excluding .distignore items
46+
mkdir -p dist
47+
# Copy plugin files to dist folder and exclude external updater
48+
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 }}"
49+
50+
# Updates for the CHANGELOG file
51+
sed -i -e '/## 1.6.0/,+4d' "dist/${{ env.SLUG }}/CHANGELOG.md"
52+
53+
# Allow updates for .org
54+
sed -i -e '/\* Update URI: false/d' "dist/${{ env.SLUG }}/faustwp.php"
55+
56+
# Create .org zip file
57+
org_zip_file="faustwp-${{ env.VERSION }}.org.zip"
58+
zip -r "$org_zip_file" "dist/${{ env.SLUG }}"
59+
60+
# Save zip path to output
61+
echo "org-zip-path=$PWD/$org_zip_file" >> $GITHUB_ENV
62+
shell: bash
63+
64+
- id: debug-org-changes
65+
name: Debug Check .org Zip File
66+
run: |
67+
echo ".org zip file path: ${{ steps.zip-org.outputs.zip-path }}"
68+
ls -lah ${{ steps.zip-org.outputs.zip-path }}
69+
unzip -l ${{ steps.zip-org.outputs.zip-path }}
70+
cat "dist/${{ env.SLUG }}/CHANGELOG.md"
71+
cat "dist/${{ env.SLUG }}/faustwp.php"
72+
shell: bash

.github/actions/release-plugin/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ runs:
4848
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 }}"
4949
5050
# Updates for the CHANGELOG file
51-
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"
51+
sed -i -e '/## 1.6.0/,+4d' "dist/${{ env.SLUG }}/CHANGELOG.md"
52+
53+
# Allow updates for .org
54+
sed -i -e '/\* Update URI: false/d' "dist/${{ env.SLUG }}/faustwp.php"
5255
5356
# Create .org zip file
5457
org_zip_file="faustwp-${{ env.VERSION }}.org.zip"

.github/workflows/debug.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Debug GitHub Actions Environment
2+
3+
on:
4+
push:
5+
branches:
6+
- chore-minor-fixes-for-faustwp-non-wpe-release
7+
8+
jobs:
9+
release_packages:
10+
name: Release Packages
11+
runs-on: ubuntu-22.04
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Ensure full Git history
17+
18+
- name: Set Plugin Version (Fallback)
19+
run: echo "PLUGIN_VERSION=1.0.0-test" >> $GITHUB_ENV
20+
21+
- name: Deploy WordPress Plugin
22+
uses: ./.github/actions/debug
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
env:
26+
PLUGIN_DIR: plugins/faustwp
27+
SLUG: faustwp
28+
VERSION: ${{ env.PLUGIN_VERSION }}

0 commit comments

Comments
 (0)