Skip to content

Commit de32574

Browse files
authored
ci: upload plugin zip to releases workflow step (#1974)
1 parent 6dc0b21 commit de32574

File tree

4 files changed

+31
-144
lines changed

4 files changed

+31
-144
lines changed
Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,41 @@
1-
name: 'WordPress Plugin Deploy'
2-
description: 'Deploy to the WordPress Plugin Repository'
3-
author: '10up'
1+
name: 'Plugin Deploy'
2+
description: 'Upload zip file to releases tab'
43
branding:
54
icon: 'upload-cloud'
65
color: 'blue'
7-
inputs:
8-
generate-zip:
9-
description: 'Generate package zip file?'
10-
default: false
6+
117
outputs:
128
zip-path:
139
description: 'Path to zip file'
14-
value: ${{ steps.deploy.outputs.zip-path }}
10+
value: ${{ steps.zip.outputs.zip-path }}
11+
1512
runs:
1613
using: 'composite'
1714
steps:
18-
- id: deploy
19-
env:
20-
INPUT_GENERATE_ZIP: ${{ inputs.generate-zip }}
21-
run: ${{ github.action_path }}/deploy.sh
15+
- id: prepare
16+
name: Prepare Environment
17+
run: |
18+
sudo apt-get update && sudo apt-get install zip rsync -y
19+
- id: zip
20+
name: Zip Plugin (optional)
21+
run: |
22+
# Create dist folder and copy files while excluding .distignore items
23+
mkdir -p dist
24+
rsync -av --exclude-from="${{ env.PLUGIN_DIR }}/.distignore" ${{ env.PLUGIN_DIR }}/ dist/${{ env.SLUG }}
25+
26+
# Zip the plugin directory
27+
zip_file="faustwp-${{ env.VERSION }}.zip"
28+
zip -r $zip_file dist/${{ env.SLUG }}
29+
30+
# Save zip path to output
31+
echo "::set-output name=zip-path::$PWD/$zip_file"
2232
shell: bash
33+
34+
- id: upload
35+
name: Upload Zip File to Release
36+
uses: softprops/action-gh-release@v2
37+
with:
38+
repo_token: ${{ secrets.GITHUB_TOKEN }}
39+
files: ${{ steps.zip.outputs.zip-path }} # Updated to use zip-path output
40+
asset_name: faustwp-${{ env.VERSION }}.zip # Set asset name to the correct versioned name
41+
overwrite: true

.github/actions/release-plugin/deploy.sh

Lines changed: 0 additions & 108 deletions
This file was deleted.

.github/workflows/release-packages.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,8 @@ jobs:
5252
# Then deploy the WordPress plugin
5353
# https://github.com/changesets/action#outputs
5454
if: steps.changesets.outputs.published && contains(steps.changesets.outputs.publishedPackages, '"@faustwp/wordpress-plugin"')
55-
# Use a variant of 10up/action-wordpress-plugin-deploy that allows us to specify a PLUGIN_DIR
56-
# to support our monorepo structure.
5755
uses: ./.github/actions/release-plugin
5856
env:
59-
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
60-
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
6157
PLUGIN_DIR: plugins/faustwp
6258
SLUG: faustwp
6359
VERSION: ${{ env.PLUGIN_VERSION }}

.github/workflows/release-plugin.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)