Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zip and Upload to GitHub Releases #1974

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from
Open
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
43 changes: 31 additions & 12 deletions .github/actions/release-plugin/action.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
name: 'WordPress Plugin Deploy'
description: 'Deploy to the WordPress Plugin Repository'
author: '10up'
name: 'Plugin Deploy'
description: 'Upload zip file to releases tab'
branding:
icon: 'upload-cloud'
color: 'blue'
inputs:
generate-zip:
description: 'Generate package zip file?'
default: false

outputs:
zip-path:
description: 'Path to zip file'
value: ${{ steps.deploy.outputs.zip-path }}
value: ${{ steps.zip.outputs.zip-path }}

runs:
using: 'composite'
steps:
- id: deploy
env:
INPUT_GENERATE_ZIP: ${{ inputs.generate-zip }}
run: ${{ github.action_path }}/deploy.sh
- id: prepare
name: Prepare Environment
run: |
sudo apt-get update && sudo apt-get install zip rsync -y
- id: zip
name: Zip Plugin (optional)
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 the plugin directory
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: upload
name: Upload Zip File to Release
uses: softprops/action-gh-release@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
files: ${{ steps.zip.outputs.zip-path }} # Updated to use zip-path output
asset_name: faustwp-${{ env.VERSION }}.zip # Set asset name to the correct versioned name
overwrite: true
108 changes: 0 additions & 108 deletions .github/actions/release-plugin/deploy.sh

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ jobs:
# Then deploy the WordPress plugin
# https://github.com/changesets/action#outputs
if: steps.changesets.outputs.published && contains(steps.changesets.outputs.publishedPackages, '"@faustwp/wordpress-plugin"')
# Use a variant of 10up/action-wordpress-plugin-deploy that allows us to specify a PLUGIN_DIR
# to support our monorepo structure.
uses: ./.github/actions/release-plugin
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
PLUGIN_DIR: plugins/faustwp
SLUG: faustwp
VERSION: ${{ env.PLUGIN_VERSION }}
20 changes: 0 additions & 20 deletions .github/workflows/release-plugin.yml

This file was deleted.

Loading