|
| 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 |
0 commit comments