-
Notifications
You must be signed in to change notification settings - Fork 0
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
Enhancement/resolve release deploy action warnings #97
Open
MaxwellGarceau
wants to merge
13
commits into
develop
Choose a base branch
from
enhancement/resolve-release-deploy-action-warnings
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
69d6e85
Replace github release action
MaxwellGarceau 213f72f
Comment out WP deploy and add workflow dispatch for testing
MaxwellGarceau d74be4f
Add dummy credentials to avoid real deploy
MaxwellGarceau a242041
Add continue on error
MaxwellGarceau 1f42bcc
Generate zip file outside of deploy to WP.org
MaxwellGarceau 7f05287
Remove testing workarounds
MaxwellGarceau d2e39e5
Rename last job step
MaxwellGarceau fd48a2b
Add test workflow file
MaxwellGarceau afd3387
Pass tag in test workflow file
MaxwellGarceau f1e2bc6
Remove whitespace and blank line
MaxwellGarceau 81873de
Add back blank line
MaxwellGarceau 6441111
Skip pre release triggers. Remove test workflow file.
MaxwellGarceau 1474fbe
Add back test workflow file for QA
MaxwellGarceau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
.github/workflows/wordpress-plugin-deploy-test-softprops-gh-release-action.yml
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,74 @@ | ||
# TODO: THIS WORKFLOW FILE IS TO TEST ISSUE #60 "Resolve release deploy action warnings" | ||
# DELETE AFTER TESTING IS COMPLETE. THIS WORKFLOW FILE IS UNNECESSARY. | ||
|
||
name: (delete after testing is done) - Test "Deploy to WordPress.org" | ||
|
||
on: | ||
# TESTING: Commented out to avoid running on the published event by mistake | ||
# release: | ||
# types: [published] | ||
|
||
# TESTING: Draft a release and then run the workflow file manually | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'The tag for the release (e.g., v1.0.0)' | ||
required: true | ||
|
||
jobs: | ||
tag: | ||
name: New release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node version and npm cache | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: 'npm' | ||
|
||
- name: Build | ||
run: | | ||
npm ci --no-optional | ||
npm run build | ||
|
||
- name: Install SVN | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install subversion | ||
|
||
# TESTING: COMMENTED OUT TO AVOID DEPLOY TO WORDPRESS.ORG DURING TESTING | ||
|
||
# - name: WordPress Plugin Deploy | ||
# id: deploy | ||
# uses: 10up/action-wordpress-plugin-deploy@stable | ||
# with: | ||
# generate-zip: true | ||
# env: | ||
# SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | ||
# SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
# SLUG: mailchimp | ||
|
||
# TESTING: Generate the WordPress Plugin zip file without deploying | ||
- name: Generate Plugin Zip File For Testing (skip deploy to WordPress.org) | ||
id: deploy | ||
run: | | ||
# Create a zip file for the plugin | ||
mkdir -p build | ||
zip -r build/mailchimp.zip . -x "*.git*" "node_modules/*" "tests/*" | ||
env: | ||
SLUG: mailchimp | ||
|
||
- name: Update GitHub release with built plugin files | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
# files: ${{ steps.deploy.outputs.zip-path }} # TESTING: Original zip file source | ||
files: build/mailchimp.zip # TESTING: Get zip file from generate plugin step | ||
tag_name: ${{ github.event.inputs.tag }} # Pass the tag from workflow_dispatch input | ||
body: | | ||
This release contains the latest updates for the WordPress plugin. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ jobs: | |
tag: | ||
name: New release | ||
runs-on: ubuntu-latest | ||
if: ${{ !github.event.release.prerelease }} # Skip job if it is a pre-release | ||
|
||
steps: | ||
- name: Checkout code | ||
|
@@ -39,12 +40,11 @@ jobs: | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
SLUG: mailchimp | ||
|
||
- name: Upload release asset | ||
uses: actions/[email protected] | ||
- name: Attach the wordpress.org plugin files to the Github release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: ${{ steps.deploy.outputs.zip-path }} | ||
body: | | ||
This release contains the latest updates for the WordPress plugin. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ steps.deploy.outputs.zip-path }} | ||
asset_name: mailchimp.zip | ||
asset_content_type: application/zip |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the Deploy to Wordpress.org Github action only runs on the publish event I've added a separate file that comments out the WordPress Plugin Deploy step and generates the zip file for the replaced step last.
This can be deleted once the PR passes code review and QA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and looks good to me so feel free to delete this file and I can move this along to UAT