-
Notifications
You must be signed in to change notification settings - Fork 101
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
GitHub workflow to build and deploy standalone plugins #686
Changes from 1 commit
db7e8a5
4eb793b
a63c123
5d720c6
a05f869
a2c11d3
5d4e5c0
91b45e0
748df3b
d315bda
511eac7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Deploy standalone plugins to WordPress.org | ||
|
||
on: | ||
push: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
paths: | ||
- '.github/workflows/deploy-standalone-plugins.yml' | ||
pull_request: | ||
branches: | ||
- trunk | ||
- 'release/**' | ||
- 'feature/**' | ||
paths: | ||
- '.github/workflows/deploy-standalone-plugins.yml' | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
jobs: | ||
release: | ||
name: New Release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
mukeshpanchal27 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- uses: actions/checkout@v3 | ||
- id: set-matrix | ||
run: echo "matrix="$(jq -c '{include:[keys[] as $k | {name:$k,slug:.[$k].slug,version:.[$k].version }]}' plugins.json) >> $GITHUB_OUTPUT | ||
mukeshpanchal27 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- uses: actions/checkout@v3 | ||
- name: Setup Node.js (.nvmrc) | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: npm | ||
- name: npm install | ||
run: npm ci | ||
- name: Building standalone plugins | ||
id: build-plugins | ||
run: npm run build-plugins | ||
deploy: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: ${{ fromJSON(needs.release.outputs.matrix) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Deploy Standalone Plugin - ${{ matrix.slug }} | ||
uses: 10up/action-wordpress-plugin-deploy@stable | ||
env: | ||
#SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
#SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | ||
SVN_PASSWORD: SVN_PASSWORD | ||
SVN_USERNAME: SVN_USERNAME | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these two lines commented out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because if somehow the workflow starts working, then it will not commit the code in SVN because of wrong access. I'll update it once everything is finalised. Thanks. |
||
SLUG: ${{ matrix.slug }} | ||
VERSION: ${{ matrix.version }} | ||
BUILD_DIR: ./build/${{ matrix.slug }} | ||
mukeshpanchal27 marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
I assume you have these here for testing, but I think we'll need to change this trigger to something different like a release, or the addition of a tag, or something. What do you think?
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.
This makes sense.
Performance Lab uses:
WordPress Beta Tester uses:
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.
Yes @joemcgill, Once we have thoroughly tested the workflow, we must update it with a
release
or pushtags
.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.
@mukeshpanchal27 Can you please add both versions of the code here so that we can proceed with the full code review? You can comment out the version which we should eventually use (on release or manual dispatch), and then add a
TODO
comment to get rid of the current triggers here before we merge this.