first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,127 @@
# Default
# To stay with fixed indent use spaces always.
* @kingyes
*.js @kobizz @matipojo
*.php @matipojo @kobizz
*.json @kingyes
*.xml @kingyes
# Assets
/assets/dev/js/editor/commands @matipojo @inewlegend
/assets/dev/js/editor/component.js @kobizz @matipojo @inewlegend
/assets/dev/js/editor/container @kobizz @matipojo @inewlegend
/assets/dev/js/editor/data @kobizz @matipojo @inewlegend
/assets/dev/js/editor/document @kobizz @matipojo @inewlegend
/assets/dev/js/editor/document.js @kobizz @matipojo @inewlegend
/assets/dev/js/editor/editor-document.js @kobizz @matipojo @inewlegend
/assets/dev/js/editor/editor.js @kobizz @matipojo @inewlegend
/assets/dev/js/modules/imports/args-object.js @kobizz @matipojo @inewlegend
/assets/dev/js/modules/imports/force-method-implementation.js @kobizz @matipojo @inewlegend
/assets/dev/js/modules/imports/instance-type.js @kobizz @matipojo @inewlegend
/assets/dev/scss @kobizz
# External Libraries
/assets/lib @kingyes
/assets/shapes @joshmarom
# Tools
/bin @kingyes
/Gruntfile.js @kingyes
/.grunt-config @kingyes
# Core
/core @kingyes
/core/admin/notices @nevoss
/core/app @matipojo @kobizz
/core/base @matipojo @kobizz
/core/base/db-upgrades-manager.php @matipojo
/core/base/background-task.php @matipojo
/core/base/background-task-manager.php @matipojo
/core/common @kobizz
/core/common/assets/js/api @kobizz @inewlegend
/core/common/modules/ajax @kobizz @matipojo
/core/common/modules/connect @matipojo
/core/common/modules/finder @kobizz
/core/debug @matipojo
/core/document-types @matipojo
/core/dynamic-tags @kobizz
/core/editor @kobizz
/core/editor/data @kobizz @inewlegend
/core/experiments @kobizz
/core/kits @matipojo @kobizz
/core/files @kobizz @matipojo
/core/logger @matipojo
/core/responsive @kobizz
/core/role-manager @kobizz
/core/settings @matipojo
/core/upgrade @matipojo
/core/utils @matipojo @kobizz
/core/utils/collection.php @nevoss
/core/utils/version.php @nevoss
# Data
/data @matipojo @kobizz @inewlegend
# Docs
/docs/core/common/assets/js/api @kobizz @matipojo @inewlegend
# Includes
/includes/admin-templates @kobizz
/includes/controls @kobizz
/includes/editor-templates @kobizz
/includes/libraries @kingyes @matipojo
/includes/managers @matipojo @kobizz
/includes/schemes @kobizz
/includes/settings @kobizz
/includes/settings/system-info @kobizz
/includes/api.php @kingyes
/includes/autoloader.php @kobizz
/includes/base/controls-stack.php @kobizz
/includes/base/element-base.php @kingyes @kobizz
/includes/base/skin-base.php @matipojo
/includes/base/widget-base.php @kingyes @kobizz
/includes/base/controls-stack.php @kobizz
/includes/compatibility.php @matipojo
/includes/conditions.php @kobizz
/includes/db.php @kingyes @matipojo
/includes/elements/column.php @kobizz
/includes/elements/repeater.php @matipojo
/includes/elements/section.php @kobizz
/includes/embed.php @kobizz
/includes/fonts.php @matipojo
/includes/frontend.php @kobizz @matipojo
/includes/heartbeat.php @matipojo
/includes/maintenance.php @matipojo
/includes/maintenance-mode.php @matipojo
/includes/plugin.php @kingyes @kobizz @matipojo
/includes/preview.php @kingyes @kobizz @matipojo
/includes/rollback.php @kingyes
/includes/shapes.php @kobizz
/includes/stylesheet.php @kobizz
/includes/tracker.php @kingyes @matipojo
/includes/user.php @kobizz
/includes/utils.php @kobizz @matipojo
# Template Library
/includes/template-library @kingyes @kobizz
# Widgets
/includes/widgets @kobizz
# Modules
/modules @matipojo
/modules/admin-bar @nevoss
/modules/compatibility-tag @nevoss
/modules/dev-tools @matipojo @inewlegend
/modules/dynamic-tags @matipojo @kobizz
/modules/landing-pages @kobizz @udidol
/modules/library @matipojo @kobizz
/modules/system-info @matipojo @kobizz
/modules/gutenberg @kingyes
/modules/usage @matipojo @inewlegend
# Tests
/tests @matipojo
/tests/qunit @matipojo @inewlegend

View File

@@ -0,0 +1,73 @@
# Contribution Guidelines
<img src="https://i.imgur.com/9Q1FFKP.png" alt="Elementor logo" width="250px">
Before filing a bug report or a feature request, be sure to read the contribution guidelines.
## How to use GitHub
We use GitHub exclusively for well-documented bugs, feature requests and code contributions. Communication is always done in English.
## Got a Question or Problem?
Please **DO NOT** open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on one of the proper support channels:
To receive free support for Elementor we have the following channels:
* [Elementor Community](https://www.facebook.com/groups/Elementors/) on Facebook
* [Elementor Knowledge base](https://docs.elementor.com)
* [Support forums](https://wordpress.org/support/plugin/elementor) on WordPress.org
If you have purchased [Elementor Pro](https://elementor.com/pro), you are entitled for personal support, please see your purchase email for details.
*To save your and our time, we will systematically close all issues that are requests for general support.*
Thanks for your understanding.
## Security Issues
Please do not report security issues here. Instead, email them to support at elementor dot com so we can deal with them securely and quickly.
## Found a Bug?
If you find a bug in the source code, you can help us by [submitting a bug report](#bug-report) issue to our [GitHub Repository](https://github.com/elementor/elementor/issues/new?template=Feature_request.md). Even better, you can submit a Pull Request with a fix.
### Bug Report
Before opening a new issue, please:
* update to the newest versions of WordPress and the Elementor/Elementor Pro plugins.
* search for duplicate issues to prevent opening a duplicate issue. If there is already an open existing issue, please comment on that issue.
* check our [Elementor Knowledge base](https://docs.elementor.com) for your issue. There are a lot of common errors documented there with possible solutions.
* follow our [Bug Report](https://github.com/elementor/elementor/issues/new?template=Bug_report.md) template when creating a new issue.
* add as much information as possible. For example: add screenshots, relevant links, step by step guides etc.
## Feature Request
Before opening a new Feature Request issue, please:
* Search for duplicate issues to prevent opening a duplicate feature request. If there is already an open existing request, please leave a comment there.
* Follow our [Feature Request](https://github.com/elementor/elementor/issues/new?template=Feature_request.md) template when creating a new issue.
* Add as much information as possible. For example: give us a clear explanation of why you think the feature request is something we should consider for Elementor.
## I want to Contribute
Community contributions are always welcome and help us remain the **Number 1 WordPress Page Builder**.
There are many ways to contribute to Elementor:
- Translating strings into your language.
- Answering questions on GitHub and within the various Elementor communities.
- Submitting fixes, improvements, and enhancements.
When contributing please ensure you follow the guidelines below so that we can keep on top of things.
#### Before Submitting a PR
Make sure your problem does not exist as an issue already by searching through [the existing issues](https://github.com/elementor/elementor/issues). If you cannot find anything which relates to your problem, please [create a new issue](https://github.com/elementor/elementor/issues/new).
#### Submitting a PR
* Fork the repository on GitHub (make sure to use the next minor version branch, not master).
* Make the changes to your forked repository.
* Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) and you properly document any new functions, actions and filters following the [documentation standards](https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/).
* When committing, reference your issue and include a note about the fix.
* Push the changes to your fork and submit a pull request to the master branch of the Elementor repository.
* make sure you follow the Pull Request Template.
We will review your pull request and merge when everything is in order. We will help you to make sure the code complies with the standards described above.
#### Additional Resources
* [Elementor API Documentation](https://developers.elementor.com)
* [Elementor Code reference](https://code.elementor.com)
* [General GitHub Documentation](https://help.github.com/)
* [GitHub Pull Request documentation](https://help.github.com/send-pull-requests/)

View File

@@ -0,0 +1,57 @@
<!-- ## BEFORE POSTING YOUR ISSUE
- Please create GitHub issues only for bugs and feature requests. GitHub issues ARE NOT FOR SUPPORT!
- If you have questions or need general support, Please use: https://wordpress.org/support/plugin/elementor
- For help and support from the Elementor community, see: https://www.facebook.com/groups/Elementors/
- To read more about Elementor, check out our documentation: https://docs.elementor.com
- Developers docs are located at: https://developers.elementor.com/
===== Guidelines ====
- Search this repository (top of the page) for the issue, and make sure it has not been fixed or reported before.
- Make sure you are using the most updated versions of Elementor, WordPress & your theme.
- Deactivate all of your plugins. If this solves the problem, gradually activate your plugins one by one, until you spot the problematic plugin.
- Change your WordPress theme to WordPress TwentySixteen (or other default WordPress theme).
- If you're requesting a new feature, explain why you'd like it to be added. Try to add as much detail as you can, and be specific.
-->
## Prerequisites
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [ ] The issue still exists against the latest stable version of Elementor.
## Description
<!--
Describe which problem you've encountered. What caused the issue, and what did you expect to happen. Attach screenshots and related links to help us understand the issue in more detail.
Please be as descriptive as possible; issues lacking the below details, or for any other reason than to report a bug, may be closed without action.
-->
## Steps to reproduce
<!--
For bug reports, list all the steps needed to reproduce your issue, so we can replicate it ourselves.
-->
## Isolating the problem
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] This bug happens with only Elementor plugin active (and Elementor Pro).
- [ ] This bug happens with a default WordPress theme active.
- [ ] I can reproduce this bug consistently using the steps above.
## Environment
<details>
<summary>System Info</summary>
```
<!-- For bug reports, let us know about your system environment: Copy and paste the system info report from Elementor => System info, and paste it here or in http://pastebin.com/ -->
```
</details>

View File

@@ -0,0 +1,63 @@
---
name: "\U0001F41E Bug report"
about: Report a bug if something isn't working as expected in the Elementor
---
<!-- ## BEFORE POSTING YOUR ISSUE
- Please create GitHub issues only for bugs and feature requests. GitHub issues ARE NOT FOR SUPPORT!
- If you have questions or need general support, Please use: https://wordpress.org/support/plugin/elementor
- For help and support from the Elementor community, see: https://www.facebook.com/groups/Elementors/
- To read more about Elementor, check out our documentation: https://docs.elementor.com
- Developers docs are located at https://developers.elementor.com/
===== Guidelines ====
- Search this repository (top of the page) for the issue, and make sure it has not been fixed or reported before.
- Make sure you are using the most updated versions of Elementor, WordPress & your theme.
- Deactivate all of your plugins. If this solves the problem, gradually activate your plugins one by one, until you spot the problematic plugin.
- Change your WordPress theme to WordPress TwentySixteen (or other default WordPress theme).
- If you're requesting a new feature, explain why you'd like it to be added. Try to add as much detail as you can, and be specific.
-->
## Prerequisites
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [ ] The issue still exists against the latest stable version of Elementor.
## Description
<!--
Describe which problem you've encountered. What caused the issue, and what did you expect to happen. Attach screenshots and related links to help us understand the issue in more detail.
Please be as descriptive as possible; issues lacking the below details, or for any other reason than to report a bug, may be closed without action.
-->
## Steps to reproduce
<!--
For bug reports, list all the steps needed to reproduce your issue, so we can replicate it ourselves.
-->
## Isolating the problem
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] This bug happens with only Elementor plugin active (and Elementor Pro).
- [ ] This bug happens with a default WordPress theme active.
- [ ] I can reproduce this bug consistently using the steps above.
## Environment
<details>
<summary>System Info</summary>
```
<!-- For bug reports, let us know about your system environment: Copy and paste the system info report from Elementor => System info, and paste it here or in http://pastebin.com/ -->
```
</details>

View File

@@ -0,0 +1,65 @@
---
name: "\U0001F41E Bug Report - Dev Edition"
about: Report a bug if something isn't working as expected in the Elementor development versions
labels: Developer Edition
---
<!-- ## BEFORE POSTING YOUR ISSUE
- Please create GitHub issues only for bugs and feature requests. GitHub issues ARE NOT FOR SUPPORT!
- If you have questions or need general support, Please use: https://wordpress.org/support/plugin/elementor
- For help and support from the Elementor community, see: https://www.facebook.com/groups/Elementors/
- To read more about Elementor, check out our documentation: https://elementor.com/help/
- Developers docs are located at https://developers.elementor.com/
===== Guidelines ====
- Search this repository (top of the page) for the issue, and make sure it has not been fixed or reported before.
- Make sure you are using the most updated versions of Elementor, WordPress & your theme.
- Deactivate all of your plugins. If this solves the problem, gradually activate your plugins one by one, until you spot the problematic plugin.
- Change your WordPress theme to WordPress TwentySixteen (or other default WordPress theme).
- If you're requesting a new feature, explain why you'd like it to be added. Try to add as much detail as you can, and be specific.
-->
## Prerequisites
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
- [ ] The issue still exists against the latest development version of Elementor.
## Description
<!--
Describe which problem you've encountered. What caused the issue, and what did you expect to happen. Attach screenshots and related links to help us understand the issue in more detail.
Please be as descriptive as possible; issues lacking the below details, or for any other reason than to report a bug, may be closed without action.
-->
## Steps to reproduce
<!--
For bug reports, list all the steps needed to reproduce your issue, so we can replicate it ourselves.
-->
## Isolating the problem
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] This bug happens with only Elementor plugin active (and Elementor Pro) with development versions.
- [ ] This bug happens with a vanilla WordPress theme active ([Hello theme](https://wordpress.org/themes/hello-elementor/)).
- [ ] I can reproduce this bug consistently using the steps above.
## Environment
<details>
<summary>System Info</summary>
```
<!-- For bug reports, let us know about your system environment: Copy and paste the system info report from Elementor => System info, and paste it here or in http://pastebin.com/ -->
```
</details>

View File

@@ -0,0 +1,16 @@
---
name: "❓Support Question"
about: If you have a support question, please refer to our docs or our Facebook Elementor
community. If this doesnt look right, choose a different type.
---
- Please create GitHub issues only for bugs and feature requests. GitHub issues ARE NOT FOR SUPPORT!
- If you have questions or need general support, Please use: https://wordpress.org/support/plugin/elementor
- For help and support from the Elementor community, see: https://www.facebook.com/groups/Elementors/
- To read more about Elementor, check out our documentation: https://docs.elementor.com
- Developers docs are located at: https://developers.elementor.com/

View File

@@ -0,0 +1,26 @@
---
name: "\U0001F195 Feature request"
about: Suggest an idea for this project
---
<!-- Before opening a new issue, please search for duplicate issues to prevent opening a duplicate feature request. If there is already an open existing request, please leave a comment there. -->
## Prerequisites
<!-- MARK COMPLETED ITEMS WITH AN [x] -->
- [ ] I have searched for similar features requests in both open and closed tickets and cannot find a duplicate.
- [ ] The feature is still missing in the latest stable version of Elementor ( Elementor Pro. )
**What problem is your feature request going to solve? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -0,0 +1,43 @@
## PR Checklist
<!--
Please check if your PR fulfills the following requirements:
**Filling out the template is required.** Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
-->
- [ ] The commit message follows our guidelines: https://github.com/elementor/elementor/blob/master/.github/CONTRIBUTING.md
## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x" with no spaces eg: [x]. -->
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] Other... Please describe:
## Summary
This PR can be summarized in the following changelog entry:
*
## Description
An explanation of what is done in this PR
*
## Test instructions
This PR can be tested by following these steps:
*
## Quality assurance
- [ ] I have tested this code to the best of my abilities
- [ ] I have added unittests to verify the code works as intended
- [ ] Docs have been added / updated (for bug fixes / features)
Fixes #

View File

@@ -0,0 +1,16 @@
#!/bin/bash
set -eo pipefail
if [[ -z "$PACKAGE_VERSION" ]]; then
echo "Missing PACKAGE_VERSION env var"
exit 1
fi
if grep -q "Beta tag:" ./readme.txt
then
echo "Replace existing beta tag in readme file"
sed -i -E "s/Beta tag: .*/Beta tag: ${PACKAGE_VERSION}/g" ./readme.txt
else
echo "Add beta tag to readme file"
sed -i -E '/^Stable tag: .*/a\'$'\n'"Beta tag: ${PACKAGE_VERSION}$(printf '\n\r')" ./readme.txt
fi

View File

@@ -0,0 +1,29 @@
'use strict';
const fs = require('fs');
const wpEnv = require('../../.wp-env.json');
const { PHP_VERSION, WP_CORE_VERSION } = process.env;
if (!PHP_VERSION) {
console.error('missing env var PHP_VERSION');
process.exit(1);
return;
}
if (!WP_CORE_VERSION) {
console.error('missing env var WP_CORE_VERSION');
process.exit(1);
return;
}
let wpCore = null;
if (WP_CORE_VERSION !== 'latest') {
wpCore = `WordPress/WordPress#${WP_CORE_VERSION}`;
}
wpEnv.phpVersion = PHP_VERSION;
wpEnv.core = wpCore;
fs.writeFileSync('.wp-env.json', JSON.stringify(wpEnv, null, 4));

View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -eo pipefail
if [[ -z "$PACKAGE_VERSION" ]]; then
echo "Missing PACKAGE_VERSION env var"
exit 1
fi
PLUGIN_ZIP_FILENAME="elementor-${PACKAGE_VERSION}.zip"
npx grunt build
mv build elementor
zip -r $PLUGIN_ZIP_FILENAME elementor
echo "PLUGIN_ZIP_FILENAME=${PLUGIN_ZIP_FILENAME}" >> $GITHUB_ENV

View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -eo pipefail
if [[ -z "$PACKAGE_VERSION" ]]; then
echo "Missing PACKAGE_VERSION env var"
exit 1
fi
bash "${GITHUB_WORKSPACE}/.github/scripts/set-git-user.sh"
echo "Commit and push bump version ${PACKAGE_VERSION}"
git commit -am "Bump ${PACKAGE_VERSION}"
git push

View File

@@ -0,0 +1,51 @@
'use strict';
const { repoToOwnerAndOwner } = require('./repo-utils');
const { Octokit } = require("@octokit/core");
const { REPOSITORY, HEAD_BRANCH_NAME, BASE_TAG_NAME, TOKEN } = process.env;
if (!TOKEN) {
console.error('missing TOKEN env var');
process.exit(1);
return;
}
if (!BASE_TAG_NAME) {
console.error('missing BASE_TAG_NAME env var');
process.exit(1);
return;
}
if (!HEAD_BRANCH_NAME) {
console.error('missing HEAD_BRANCH_NAME env var');
process.exit(1);
return;
}
if (!REPOSITORY) {
console.error('missing REPOSITORY env var');
process.exit(1);
return;
}
const octokit = new Octokit({ auth: TOKEN });
(async () => {
try {
const { owner, repo } = repoToOwnerAndOwner(REPOSITORY);
const res = await octokit.request('GET /repos/{owner}/{repo}/compare/{base}...{head}', {
owner,
repo,
base: BASE_TAG_NAME,
head: HEAD_BRANCH_NAME,
});
const compareStatus = res.data.status;
console.log(`Tag: ${BASE_TAG_NAME} '${compareStatus}' to branch: ${HEAD_BRANCH_NAME}`);
if (compareStatus !== 'identical') {
process.exit(1);
}
} catch (err) {
console.error(`Failed to compare tag: ${BASE_TAG_NAME} to branch: ${HEAD_BRANCH_NAME} error: ${err.message}`);
process.exit(1);
}
})();

View File

@@ -0,0 +1,12 @@
#!/bin/bash
if [[ -z "$PACKAGE_VERSION" ]]; then
echo "Missing PACKAGE_VERSION env var"
exit 1
fi
bash "${GITHUB_WORKSPACE}/.github/scripts/set-git-user.sh"
echo "Create tag v${PACKAGE_VERSION}"
git tag "v${PACKAGE_VERSION}"
git push origin "v${PACKAGE_VERSION}"

View File

@@ -0,0 +1,54 @@
'use strict';
const fs = require('fs');
const { Octokit } = require('@octokit/core');
const { repoToOwnerAndOwner } = require('./repo-utils');
const { REPOSITORY, HEAD_BRANCH_NAME, BASE_TAG_NAME, TOKEN } = process.env;
if (!TOKEN) {
console.error('missing TOKEN env var');
process.exit(1);
return;
}
if (!REPOSITORY) {
console.error('missing REPOSITORY env var');
process.exit(1);
return;
}
if (!HEAD_BRANCH_NAME) {
console.error('missing HEAD_BRANCH_NAME env var');
process.exit(1);
return;
}
if (!BASE_TAG_NAME) {
console.error('missing BASE_TAG_NAME env var');
process.exit(1);
return;
}
const octokit = new Octokit({ auth: TOKEN });
const { owner, repo } = repoToOwnerAndOwner(REPOSITORY);
(async () => {
try {
const res = await octokit.request('GET /repos/{owner}/{repo}/compare/{base}...{head}', {
owner,
repo,
base: BASE_TAG_NAME,
head: HEAD_BRANCH_NAME,
});
const prAndVerifiedCommits = res.data.commits
.filter(({ commit }) => commit.verification.verified)
.map(({ commit }) => commit.message)
.map(message => message.split('\n')[0])
.filter((message) => /\(#\d{1,72}\)/.test(message))
.filter((message) => !message.startsWith('Internal:'));
const markdown = prAndVerifiedCommits.map((message) => `* ${message}`).join('\n');
fs.writeFileSync('temp-changelog.txt', markdown);
} catch (err) {
process.exit(1);
}
})();

View File

@@ -0,0 +1,12 @@
'use strict';
const packageJson = require('../../package.json');
const { last_beta_version = '', version } = packageJson;
const semver = require('semver');
(() => {
const versionOfBeta = last_beta_version.split('-')[0];
if (versionOfBeta && semver.gt(versionOfBeta, version)) {
console.log(last_beta_version);
}
})();

View File

@@ -0,0 +1,28 @@
'use strict';
const marked = require("marked");
const fs = require('fs');
const { VERSION } = process.env;
if (!VERSION) {
console.error('missing VERSION env var');
process.exit(1);
return;
}
(async () => {
try {
const changelogText = fs.readFileSync('readme.txt', 'utf-8');
const data = marked.lexer(changelogText);
const headerIndex = data.findIndex((section) => section.type === 'paragraph' && section.text.startsWith(`= ${VERSION}`));
if (headerIndex === -1) {
console.error(`Failed to find version: ${VERSION} in readme.txt file`);
process.exit(1);
return;
}
const versionLog = data[headerIndex + 1].raw;
fs.writeFileSync('temp-changelog-from-readme.txt', versionLog);
} catch (err) {
process.exit(1);
}
})();

View File

@@ -0,0 +1,14 @@
#!/bin/bash
set -eo pipefail
if [ -z "$INPUT_VERSION" ];
then
PACKAGE_VERSION=$(node -p "require('./package.json').version")
npm install --no-package-lock --no-save semver@7.3.4
NEXT_PACKAGE_VERSION=$(npx semver $PACKAGE_VERSION -i minor)
RELEASE_BRANCH="release/${NEXT_PACKAGE_VERSION}"
else
echo "Version var is set to ${INPUT_VERSION}"
RELEASE_BRANCH="release/${INPUT_VERSION}"
fi
echo "RELEASE_BRANCH=${RELEASE_BRANCH}" >> $GITHUB_ENV

View File

@@ -0,0 +1,39 @@
#!/bin/bash
set -eo pipefail
if [[ -z "$SVN_USERNAME" ]]; then
echo "Set the SVN_USERNAME secret"
exit 1
fi
if [[ -z "$SVN_PASSWORD" ]]; then
echo "Set the SVN_PASSWORD secret"
exit 1
fi
if [[ -z "$PLUGIN_VERSION" ]]; then
echo "Set the PLUGIN_VERSION env var"
exit 1
fi
echo "Publish version: ${PLUGIN_VERSION}"
ELEMENTOR_PATH="$GITHUB_WORKSPACE/elementor"
SVN_PATH="$GITHUB_WORKSPACE/svn"
cd $ELEMENTOR_PATH
mkdir -p $SVN_PATH
cd $SVN_PATH
svn co https://plugins.svn.wordpress.org/elementor/trunk
echo "Preparing files"
cd $SVN_PATH/trunk
cp $ELEMENTOR_PATH/readme.txt .
svn status
echo "Commit readme file to trunk"
svn ci readme.txt -m "Upload v${PLUGIN_VERSION}" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
echo "Copy files from trunk to tag ${PLUGIN_VERSION}"
svn cp https://plugins.svn.wordpress.org/elementor/trunk https://plugins.svn.wordpress.org/elementor/tags/${PLUGIN_VERSION} --message "Tagged ${PLUGIN_VERSION}" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
svn update

View File

@@ -0,0 +1,54 @@
#!/bin/bash
set -eo pipefail
if [[ -z "$SVN_USERNAME" ]]; then
echo "Set the SVN_USERNAME secret"
exit 1
fi
if [[ -z "$SVN_PASSWORD" ]]; then
echo "Set the SVN_PASSWORD secret"
exit 1
fi
if [[ -z "$PLUGIN_VERSION" ]]; then
echo "Set the PLUGIN_VERSION env var"
exit 1
fi
echo "Publish version: ${PLUGIN_VERSION}"
ELEMENTOR_PATH="$GITHUB_WORKSPACE/elementor"
SVN_PATH="$GITHUB_WORKSPACE/svn"
cd $ELEMENTOR_PATH
mkdir -p $SVN_PATH
cd $SVN_PATH
echo "Checkout from SVN"
svn co https://plugins.svn.wordpress.org/elementor/trunk
echo "Clean trunk folder"
cd $SVN_PATH/trunk
find . -maxdepth 1 -not -name ".svn" -not -name "." -not -name ".." -exec rm -rf {} +
echo "Copy files"
rsync -ah --progress $ELEMENTOR_PATH/* $SVN_PATH/trunk
echo "Preparing files"
cd $SVN_PATH/trunk
echo "svn delete"
svn status | grep -v '^.[ \t]*\\..*' | { grep '^!' || true; } | awk '{print $2}' | xargs -r svn delete;
echo "svn add"
svn status | grep -v '^.[ \t]*\\..*' | { grep '^?' || true; } | awk '{print $2}' | xargs -r svn add;
svn status
echo "Commit files to trunk"
svn ci -m "Upload v${PLUGIN_VERSION}" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
echo "Copy files from trunk to tag ${PLUGIN_VERSION}"
svn cp https://plugins.svn.wordpress.org/elementor/trunk https://plugins.svn.wordpress.org/elementor/tags/${PLUGIN_VERSION} --message "Tagged ${PLUGIN_VERSION}" --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD"
svn update

View File

@@ -0,0 +1,4 @@
#!/bin/bash
set -eo pipefail
sed -i -E '/^Beta tag:/d' ./readme.txt

View File

@@ -0,0 +1,41 @@
'use strict';
module.exports.repoToOwnerAndOwner = (repository = '') => {
const [owner, repo] = repository.split('/');
return { owner, repo };
};
module.exports.mergeBranch = async (auth, owner, repo, base, head, commitMessage) => {
const { Octokit } = require("@octokit/core");
const octokit = new Octokit({ auth });
try {
await octokit.request('POST /repos/{owner}/{repo}/merges', {
owner,
repo,
base,
head,
commit_message: commitMessage
});
} catch (err) {
err.head = head;
err.base = base;
throw err;
}
}
const getBranches = async (auth, owner, repo) => {
const { Octokit } = require("@octokit/core");
const octokit = new Octokit({ auth });
return await octokit.request('GET /repos/{owner}/{repo}/branches?per_page={per_page}', {
owner,
repo,
per_page: 100,
});
};
module.exports.getFeatureBranches = async (auth, owner, repo) => {
const res = await getBranches(auth, owner, repo);
return res.data.map(({ name }) => name).filter((name) => name.startsWith('feature/'));
}

View File

@@ -0,0 +1,22 @@
#!/bin/bash
TEMPLATES_FILE_NAMES=`ls ${GITHUB_WORKSPACE}/tests/lighthouse/templates/*.json`
max_exit=0
set_max_exit() {
for i in "${PIPESTATUS[@]}"; do
[ "$i" -gt "$max_exit" ] && max_exit=$i
done
}
for TEMPLATE_FILE_NAME in $TEMPLATES_FILE_NAMES
do
TEMPLATE_NAME=$(basename "$TEMPLATE_FILE_NAME" .json)
export TEMPLATE_NAME=${TEMPLATE_NAME}
npx lhci collect --url="http://localhost:8889/${TEMPLATE_NAME}/"
npx lhci assert
set_max_exit
npx lhci upload --outputDir="${GITHUB_WORKSPACE}/.lighthouseci/reports/${TEMPLATE_NAME}/"
done
exit "$max_exit"

View File

@@ -0,0 +1,10 @@
#!/bin/bash
TEMPLATES_FILE_NAMES=`ls ${GITHUB_WORKSPACE}/tests/lighthouse/templates/*.json`
mkdir -p .lighthouseci/dumps
for TEMPLATE_FILE_NAME in $TEMPLATES_FILE_NAMES
do
TEMPLATE_NAME=$(basename "$TEMPLATE_FILE_NAME" .json)
wget --directory-prefix=.lighthouseci/dumps/${TEMPLATE_NAME} --mirror --convert-links --adjust-extension --page-requisites --no-parent --no-host-directories --restrict-file-names=windows http://localhost:8889/${TEMPLATE_NAME}/
done

View File

@@ -0,0 +1,6 @@
#!/bin/bash
set -eo pipefail
echo "Set git bot user"
git config user.name ${MAINTAIN_USERNAME}
git config user.email ${MAINTAIN_EMAIL}

View File

@@ -0,0 +1,26 @@
#!/bin/bash
set -eo pipefail
if [[ -z "$SLACK_TOKEN" ]]; then
echo "Missing SLACK_TOKEN env var"
exit 1
fi
if [[ -z "$PACKAGE_VERSION" ]]; then
echo "Missing PACKAGE_VERSION env var"
exit 1
fi
if [[ -z "$SLACK_CHANNELS" ]]; then
echo "Missing SLACK_CHANNELS env var"
exit 1
fi
SLACK_CHANNELS_ARRAY=(`echo $SLACK_CHANNELS | sed 's/,/\n/g'`)
SLACK_BOT_NAME="ElementorBot"
messageText="@channel Elementor \`v${PACKAGE_VERSION}\` has been released! Saddle up partners!"
for CHANNEL in "${SLACK_CHANNELS_ARRAY[@]}"
do
curl -X POST "https://slack.com/api/chat.postMessage" -d "username=${SLACK_BOT_NAME}&token=${SLACK_TOKEN}&channel=${CHANNEL}&text=${messageText}&link_names=true"
done

View File

@@ -0,0 +1,22 @@
#!/bin/bash
bash "${GITHUB_WORKSPACE}/.github/scripts/set-git-user.sh"
npm i semver@7.3.4 --no-package-lock --no-save
PACKAGE_VERSION=$(node -p "require('./package.json').version")
NEXT_PACKAGE_VERSION=$(npx semver $PACKAGE_VERSION -i minor)
NEXT_RELEASE_BRANCH="release/${NEXT_PACKAGE_VERSION}"
git checkout "${NEXT_RELEASE_BRANCH}"
if [ $? -eq 0 ]; then
git merge origin/develop
git push
git checkout developer-edition
git merge "${NEXT_RELEASE_BRANCH}"
git push
echo "NEXT_RELEASE_BRANCH=${NEXT_RELEASE_BRANCH}" >> $GITHUB_ENV
else
git checkout developer-edition
git merge origin/develop
git push
fi

View File

@@ -0,0 +1,26 @@
#!/bin/bash
set -eo pipefail
bash "${GITHUB_WORKSPACE}/.github/scripts/set-git-user.sh"
npm i semver@7.3.4 --no-package-lock --no-save
PACKAGE_VERSION=$(node -p "require('./package.json').version")
NEXT_PACKAGE_VERSION=$(npx semver $PACKAGE_VERSION -i minor)
NEXT_RELEASE_BRANCH="release/${NEXT_PACKAGE_VERSION}"
# Merge master -> develop
git checkout develop
git merge origin/master
git push origin develop
# Merge develop -> next release
git checkout "${NEXT_RELEASE_BRANCH}"
git merge origin/develop
git push origin "${NEXT_RELEASE_BRANCH}"
# Merge next release -> developer-edition
git checkout developer-edition
git merge "${NEXT_RELEASE_BRANCH}"
git push origin developer-edition
echo "NEXT_RELEASE_BRANCH=${NEXT_RELEASE_BRANCH}" >> $GITHUB_ENV

View File

@@ -0,0 +1,37 @@
'use strict';
const {
repoToOwnerAndOwner,
getFeatureBranches,
mergeBranch,
} = require('./repo-utils');
const { REPOSITORY, TOKEN } = process.env;
const TARGET_BRANCH = 'developer-edition';
if (!TOKEN) {
console.error('missing TOKEN env var');
process.exit(1);
return;
}
if (!REPOSITORY) {
console.error('missing REPOSITORY env var');
process.exit(1);
return;
}
const { owner, repo } = repoToOwnerAndOwner(REPOSITORY);
(async () => {
try {
const featureBranches = await getFeatureBranches(TOKEN, owner, repo);
for (const branchName of featureBranches) {
await mergeBranch(TOKEN, owner, repo, TARGET_BRANCH, branchName, `Auto merge feature branch: ${branchName}`);
}
} catch (err) {
console.error(`Failed to merge feature branches to: ${TARGET_BRANCH} branch ${err.head ? `from: ${err.head} branch` : ''} error: ${err.message}`);
process.exit(1);
}
})();

View File

@@ -0,0 +1,41 @@
'use strict';
const {
repoToOwnerAndOwner,
getFeatureBranches,
mergeBranch,
} = require('./repo-utils');
const { REPOSITORY, TOKEN, NEXT_RELEASE_BRANCH } = process.env;
if (!TOKEN) {
console.error('missing TOKEN env var');
process.exit(1);
return;
}
if (!REPOSITORY) {
console.error('missing REPOSITORY env var');
process.exit(1);
return;
}
if (!NEXT_RELEASE_BRANCH) {
console.error('missing NEXT_RELEASE_BRANCH env var');
process.exit(1);
return;
}
const { owner, repo } = repoToOwnerAndOwner(REPOSITORY);
(async () => {
try {
const featureBranches = await getFeatureBranches(TOKEN, owner, repo);
for (const branchName of featureBranches) {
await mergeBranch(TOKEN, owner, repo, branchName, NEXT_RELEASE_BRANCH, `Auto merge ${NEXT_RELEASE_BRANCH} branch into feature branch: ${branchName}`);
}
} catch (err) {
console.error(`Failed to merge ${NEXT_RELEASE_BRANCH} branch into ${err.base || ''} error: ${err.message}`);
process.exit(1);
}
})();

View File

@@ -0,0 +1,57 @@
'use strict';
const semverInc = require('semver/functions/inc');
const packageJson = require('../../package.json');
const fs = require('fs');
const preId = process.argv[2];
if (!['dev', 'beta'].includes(preId)) {
console.error('missing argument dev or beta mode');
process.exit(1);
return;
}
const bumpVersion = (relativeVersion, lastVersionTagName, bumpsFromCurrentVersion = 1) => {
const lastVersion = packageJson[lastVersionTagName] || '';
let expectedVersion = relativeVersion;
(new Array(bumpsFromCurrentVersion).fill(1)).forEach(() => {
expectedVersion = semverInc(expectedVersion, 'minor');
});
let currentLastVersionNumber = 0;
if (lastVersion) {
const splitVersion = lastVersion.split(`-${preId}`);
if (splitVersion[0] === expectedVersion) {
const currentLastVersion = splitVersion[splitVersion.length - 1];
currentLastVersionNumber = Number(currentLastVersion);
if (Number.isNaN(currentLastVersionNumber)) {
console.error(`invalid ${preId} version: ${currentLastVersion}`);
process.exit(1);
return;
}
}
}
const newVersion = `${expectedVersion}-${preId}${currentLastVersionNumber + 1}`;
packageJson[lastVersionTagName] = newVersion;
fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 4));
console.log(newVersion);
}
if (preId === 'beta') {
const relativeVersion = packageJson.version;
bumpVersion(relativeVersion, 'last_beta_version');
return;
}
if (preId === 'dev') {
const lastBetaVersion = (() => {
const attrValue = packageJson.last_beta_version;
if (!attrValue) {
return '';
}
return attrValue.split('-')[0];
})();
const relativeVersion = lastBetaVersion || packageJson.version;
bumpVersion(relativeVersion, 'last_dev_version');
}

View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -eo pipefail
if [[ -z "$PACKAGE_VERSION" ]]; then
echo "Missing PACKAGE_VERSION env var"
exit 1
fi
sed -i -E "s/Stable tag: .*/Stable tag: ${PACKAGE_VERSION}/g" ./readme.txt

View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -eo pipefail
if [[ -z "$PACKAGE_VERSION" ]]; then
echo "Missing PACKAGE_VERSION env var"
exit 1
fi
sed -i -E "s/Version: .*/Version: ${PACKAGE_VERSION}/g" elementor.php
sed -i -E "s/ELEMENTOR_VERSION', '.*'/ELEMENTOR_VERSION', '${PACKAGE_VERSION}'/g" elementor.php

View File

@@ -0,0 +1,56 @@
name: Build
on:
push:
branches:
- 'develop'
- 'release/*'
jobs:
run:
runs-on: ubuntu-16.04
if: startsWith( github.repository, 'elementor/' )
steps:
- name: Checkout source code
uses: actions/checkout@master
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: npm install
- name: Build and Deploy
run: |
npm config set git-tag-version false
if [ "${GITHUB_REF:11}" == "develop" ];
then npm version patch
fi
if [[ "${GITHUB_REF:11:7}" == "release" ]];
then npm version minor
fi
export PLUGIN_VERSION=$(date '+%Y%m%d.%H%M')
export PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
export PLUGIN_ZIP_FILENAME="elementor-${PACKAGE_VERSION}-${PLUGIN_VERSION}.zip"
grunt build
sed -i -E "s/Version: (.*?)/Version: ${PACKAGE_VERSION}-${PLUGIN_VERSION}/g" build/elementor.php
sed -i -E "s/ELEMENTOR_VERSION', '(.*?)'/ELEMENTOR_VERSION', '${PACKAGE_VERSION}-${PLUGIN_VERSION}'/g" build/elementor.php
mv build elementor
zip -r $PLUGIN_ZIP_FILENAME elementor
curl --fail -F "package=@${PLUGIN_ZIP_FILENAME}" "${{ secrets.DEPLOY_BUILDS_ENDPOINT}}&type=core"
echo "PLUGIN_ZIP_FILENAME=${PLUGIN_ZIP_FILENAME}" >> $GITHUB_ENV
- uses: actions/upload-artifact@master
with:
name: ${{ env.PLUGIN_ZIP_FILENAME }}
path: elementor-*.zip

View File

@@ -0,0 +1,27 @@
name: Elementor Tests / Init
on: [push, pull_request_target]
jobs:
run:
if: github.repository_owner == 'elementor'
runs-on: ubuntu-16.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@master
- name: Block non-permitted users
uses: StyleShit/action-whitelist-users@b8abcef5472afd0c7bcfaadf08c70a082437e459
with:
whitelist-file: '.github/workflows/whitelist.txt'
- name: Elementor Tests / Init
env:
TOKEN: ${{ secrets.MAINTAIN_TOKEN }} # GitHub access token to access the remote repo.
REMOTE_TESTS_REPO: ${{ secrets.REMOTE_TESTS_REPO }} # Remote tests repo, e.g. `owner/repo-name`.
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name || github.repository }} # The HEAD repo that initiated the push/PR.
uses: peter-evans/repository-dispatch@d57191493a947e8da4f7bf3fbc389e5b20f21cdf
with:
token: ${{ env.TOKEN }}
repository: ${{ env.REMOTE_TESTS_REPO }}
event-type: remote-tests
client-payload: '{ "repository": "${{ env.HEAD_REPO }}", "sha": "${{ github.head_ref || github.sha }}", "run_id": "${{ github.run_id }}" }'

View File

@@ -0,0 +1,28 @@
name: JS-Qunit
on: [push, pull_request]
jobs:
Qunit:
runs-on: ubuntu-16.04
if: startsWith( github.repository, 'elementor/' )
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: npm ci
- name: "Grunt Scripts"
run: npx grunt scripts
- name: "Run Qunit"
run: npx grunt karma:unit

View File

@@ -0,0 +1,122 @@
name: Lighthouse
on:
push:
pull_request:
schedule:
- cron: '0 10 * * 0' # run at 10 AM UTC on Sunday
jobs:
build-plugin:
name: Build plugin
runs-on: ubuntu-latest
if: startsWith( github.repository, 'elementor/' )
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm install
- name: Build
run: npx grunt build
- name: Save build to cache
uses: actions/cache@v2
id: restore-build
with:
path: ./build/*
key: ${{ github.sha }}
lighthouse:
name: Lighthouse test - WP ${{ matrix.wpCoreVersion }} on PHP ${{ matrix.phpVersion }}
runs-on: ubuntu-latest
needs: [build-plugin]
strategy:
matrix:
include:
- phpVersion: '8.0'
wpCoreVersion: 'master'
- phpVersion: '7.4'
wpCoreVersion: 'latest'
steps:
- name: Checkout source code
if: matrix.wpCoreVersion != 'master' || github.event_name == 'schedule'
uses: actions/checkout@v2
- name: Install Node.js 14.x
if: matrix.wpCoreVersion != 'master' || github.event_name == 'schedule'
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Restore build from cache
if: matrix.wpCoreVersion != 'master' || github.event_name == 'schedule'
uses: actions/cache@v2
id: restore-build
with:
path: ./build/*
key: ${{ github.sha }}
- name: Update wp-env.json file
if: matrix.wpCoreVersion != 'master' || github.event_name == 'schedule'
env:
PHP_VERSION: ${{ matrix.phpVersion }}
WP_CORE_VERSION: ${{ matrix.wpCoreVersion }}
run: node ./.github/scripts/build-wp-env.js
- name: Install wp-env and lhci
if: matrix.wpCoreVersion != 'master' || github.event_name == 'schedule'
run: npm install --no-package-lock --no-save @wordpress/env@4.0.0 @lhci/cli@0.8.0
- name: Install WordPress environment
if: matrix.wpCoreVersion != 'master' || github.event_name == 'schedule'
run: |
npx wp-env start
# change wp-env folder owner to www-data
sudo chown 33:33 -R ~/wp-env/
npx wp-env run tests-cli "bash -c 'bash elementor-config/import-temapltes.sh'"
- name: WordPress debug information
if: matrix.wpCoreVersion != 'master' || github.event_name == 'schedule'
run: |
npx wp-env run tests-cli "wp core version"
npx wp-env run tests-cli "wp --info"
- name: Run Lighthouse tests
if: matrix.wpCoreVersion != 'master' || github.event_name == 'schedule'
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/run-lighthouse-tests.sh"
- name: Save HTML dumps on failure
if: failure()
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/save-lighthouse-pages-html-dumps.sh"
- name: Upload Lighthouse reports on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: lighthouseci-reports
path: ${{ github.workspace }}/.lighthouseci/reports/**/*
retention-days: 7
- name: Upload Lighthouse HTML dumps on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: lighthouseci-htmls
path: ${{ github.workspace }}/.lighthouseci/dumps/**/*
retention-days: 7
- name: Notify slack on failure
if: failure() && github.event_name == 'schedule'
env:
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL: ${{ secrets.SLACK_LIGHTHOUSE_CHANNEL }}
SLACK_BOT_NAME: ElementorBot
run: |
MESSAGE_TEXT="@channel Repo: *$GITHUB_REPOSITORY* Workflow: *$GITHUB_WORKFLOW* is FAILED - <$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|link>"
curl -X POST "https://slack.com/api/chat.postMessage" -d "username=${SLACK_BOT_NAME}&token=${SLACK_TOKEN}&channel=${SLACK_CHANNEL}&text=${MESSAGE_TEXT}&link_names=true"

View File

@@ -0,0 +1,55 @@
name: Lint
on: [push, pull_request]
jobs:
JS-Lint:
runs-on: ubuntu-16.04
if: startsWith( github.repository, 'elementor/' )
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: npm i
- name: Run Lint
run: ./node_modules/eslint/bin/eslint.js .
PHP-Lint:
runs-on: ubuntu-16.04
if: startsWith( github.repository, 'elementor/' )
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Setup PHP 7.4
uses: shivammathur/setup-php@9882bed06691b3a085010c1602ce43ef18f15c5b # v2
with:
php-version: '7.4'
- name: Install Dependencies
run: |
composer global require "squizlabs/php_codesniffer=*"
composer global require wp-coding-standards/wpcs
composer require php-parallel-lint/php-parallel-lint
- name: Run Lint
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
phpcs -p -s -n . --standard=./ruleset.xml --extensions=php
- name: Run PHP Syntax Lint
run: |
export PATH=$HOME/.composer/vendor/bin:$PATH
php5.6 vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .
php7.0 vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .
php7.1 vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .
php7.2 vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .
php7.3 vendor/bin/parallel-lint --blame --exclude node_modules --exclude vendor .

View File

@@ -0,0 +1,48 @@
name: PHPUnit
on: [push, pull_request]
jobs:
run:
runs-on: ubuntu-16.04
if: startsWith( github.repository, 'elementor/' )
strategy:
fail-fast: false
matrix:
wordpress_versions: ['latest', '5.5', '5.4', '5.3']
name: WordPress ${{ matrix.wordpress_versions }}
steps:
- name: Startup MySQL service
run: sudo /etc/init.d/mysql start
- name: Checkout source code
uses: actions/checkout@master
- name: Install Dependencies
run: |
bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wordpress_versions }}
wget --quiet -O /tmp/phpunit-5 https://phar.phpunit.de/phpunit-5.phar
wget --quiet -O /tmp/phpunit-6 https://phar.phpunit.de/phpunit-6.phar
wget --quiet -O /tmp/phpunit-7 https://phar.phpunit.de/phpunit-7.phar
- name: PHP5.6
run: php5.6 /tmp/phpunit-5
- name: PHP5.6 - Multisite
run: WP_MULTISITE=1 php5.6 /tmp/phpunit-5
- name: PHP7.0
run: php7.0 /tmp/phpunit-6
- name: PHP7.0 - Multisite
run: WP_MULTISITE=1 php7.0 /tmp/phpunit-6
- name: PHP7.1
run: php7.1 /tmp/phpunit-6
- name: PHP7.1 - Multisite
run: WP_MULTISITE=1 php7.1 /tmp/phpunit-6
- name: PHP7.2
run: php7.2 /tmp/phpunit-6
- name: PHP7.2 - Multisite
run: WP_MULTISITE=1 php7.2 /tmp/phpunit-6
- name: PHP7.3
run: php7.3 /tmp/phpunit-6
- name: PHP7.3 - Multisite
run: WP_MULTISITE=1 php7.3 /tmp/phpunit-6
- name: PHP7.4
run: php7.4 /tmp/phpunit-7
- name: PHP7.4 - Multisite
run: WP_MULTISITE=1 php7.4 /tmp/phpunit-7

View File

@@ -0,0 +1,15 @@
name: PR Linter
on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']
jobs:
pr_name_lint:
runs-on: ubuntu-latest
if: startsWith( github.repository, 'elementor/' )
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: npm install --no-package-lock --no-save @commitlint/config-conventional@12.1.1 @commitlint/cli@12.1.1
- name: Run PR name linter
run: echo "${{ github.event.pull_request.title }}" | npx commitlint

View File

@@ -0,0 +1,71 @@
name: Promote Canary Release
on:
workflow_dispatch:
jobs:
update-readme-develop:
if: (github.actor == 'ronkelementor' || github.actor == 'KingYes') && startsWith(github.repository, 'elementor/')
runs-on: ubuntu-16.04
steps:
- name: Checkout develop branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: develop
- name: Bump version
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
- name: Push new version to develop
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/remove-readme-beta-tag.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/update-readme-stable-version.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/commit-push-bump.sh"
promote:
needs: update-readme-develop
runs-on: ubuntu-16.04
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Merge develop -> master
uses: devmasx/merge-branch@a1752b9ba42bb417ec19be7dc974e2faf77d3ef2 # v1.3.1
with:
type: now
from_branch: develop
target_branch: master
github_token: ${{ secrets.MAINTAIN_TOKEN }}
- name: Checkout updated master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Install Dependencies
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
npm install
- name: Build
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/build-zip.sh"
- name: Publish to WordPress.org SVN
env:
PLUGIN_VERSION: ${{ env.PACKAGE_VERSION }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-readme-to-wordpress-org.sh"
- name: Upload zip file to GitHub actions artifact
uses: actions/upload-artifact@v2
with:
name: elementor-${{ env.PACKAGE_VERSION }}
path: ${{ github.workspace }}/elementor/**/*

View File

@@ -0,0 +1,153 @@
name: Publish Beta Version
on:
workflow_dispatch:
jobs:
bump-version:
if: (github.actor == 'ronkelementor' || github.actor == 'KingYes') && startsWith(github.repository, 'elementor/')
runs-on: ubuntu-16.04
outputs:
prev_version: ${{ steps.bump_version_step.outputs.prev_version }}
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Get release branch
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/get-release-branch-name.sh"
- name: Checkout next release branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: ${{ env.RELEASE_BRANCH }}
- name: Bump version
id: bump_version_step
run: |
npm install --no-package-lock --no-save semver@7.3.4
PREV_PACKAGE_VERSION=$(node -p "require('./package.json').last_beta_version")
NEW_PACKAGE_VERSION=$(node ./.github/scripts/update-prerelease-version.js beta)
PACKAGE_VERSION=$(node -p "require('./package.json').last_beta_version")
if [[ $PACKAGE_VERSION == *beta1 ]]
then
PREV_PACKAGE_VERSION=$(node -p "require('./package.json').version")
fi
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
echo "::set-output name=prev_version::${PREV_PACKAGE_VERSION}"
- name: Push new version to beta version to release branch
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/commit-push-bump.sh"
publish:
needs: bump-version
runs-on: ubuntu-16.04
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Get release branch
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/get-release-branch-name.sh"
- name: Checkout next release branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: ${{ env.RELEASE_BRANCH }}
- name: Install Dependencies
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').last_beta_version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
npm ci
- name: Build
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/add-to-readme-beta-tag.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/update-version-elementor-php.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/build-zip.sh"
- name: Publish to WordPress.org SVN
env:
PLUGIN_VERSION: ${{ env.PACKAGE_VERSION }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-to-wordpress-org.sh"
- name: Upload zip file to GitHub actions artifact
uses: actions/upload-artifact@v2
with:
name: elementor-${{ env.PACKAGE_VERSION }}
path: ${{ github.workspace }}/elementor/**/*
if-no-files-found: error
- name: Create tag
env:
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/create-git-tag.sh"
- name: Generate changelog
env:
TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
REPOSITORY: ${{ github.repository }}
HEAD_BRANCH_NAME: v${{ env.PACKAGE_VERSION }}
BASE_TAG_NAME: v${{ needs.bump-version.outputs.prev_version }}
run: |
npm install --no-package-lock --no-save @octokit/core@3.4.0
node ./.github/scripts/generate-changelog.js
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.PACKAGE_VERSION }}
files: elementor-*.zip
prerelease: true
body_path: temp-changelog.txt
env:
GITHUB_TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
- name: Read changelog and set current date
run: |
CHANGELOG=$(cat temp-changelog.txt | tr -d '\n')
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "CHANGELOG=${CHANGELOG}" >> $GITHUB_ENV
echo "NOW=${NOW}" >> $GITHUB_ENV
- name: Parse Jira Keys from changelog
id: jira_keys
uses: HighwayThree/jira-extract-issue-keys@8050830121f3eab19553d2f0c0150873a8d1b51b
with:
commit-message: '${{ env.CHANGELOG }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push Deployment Info to Jira
if: steps.jira_keys.outputs.jira-keys != ''
uses: HighwayThree/jira-upload-deployment-info@7cd4db1e5cc96692fd0b4c688407efd95ae3e610
with:
client-id: '${{ secrets.JIRA_CLIENT_ID }}'
client-secret: '${{ secrets.JIRA_CLIENT_SECRET }}'
cloud-instance-base-url: '${{ secrets.JIRA_CLOUD_INSTANCE_BASE_URL }}'
issue-keys: "${{ steps.jira_keys.outputs.jira-keys }}"
display-name: "${{ env.PACKAGE_VERSION }}"
url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
description: "This PR was merged to the following release(s)"
last-updated: '${{ env.NOW }}'
state: 'successful'
pipeline-id: '${{ github.repository }} ${{ github.workflow }}'
pipeline-url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
environment-id: "${{ env.PACKAGE_VERSION }}"
environment-display-name: "${{ env.PACKAGE_VERSION }}"
environment-type: 'staging'
- name: Notify Slack
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNELS: ${{ secrets.SLACK_CHANNELS }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/slack-notify.sh"

View File

@@ -0,0 +1,173 @@
name: Publish Developer Edition Version
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *' # run at 10 AM UTC
repository_dispatch:
types: [new-release]
jobs:
bump-version:
if: (github.event_name == 'schedule' || github.event_name == 'repository_dispatch' || github.actor == 'ronkelementor' || github.actor == 'KingYes') && startsWith(github.repository, 'elementor/')
runs-on: ubuntu-16.04
outputs:
cancel_workflow: ${{ steps.step_compare.outputs.cancel_workflow }}
prev_version: ${{ steps.bump_version_step.outputs.prev_version }}
steps:
- name: Check developer-edition GitHub checks
uses: ronkelementor/confirm-checks-action@f1f421685b34aaf0b1933b47cc9344c3a35307d6 # main
with:
github_token: ${{ secrets.MAINTAIN_TOKEN }}
commit: developer-edition
checks: 'JS-Lint,PHP-Lint,Qunit,Lighthouse test - WP latest on PHP 7.4'
- name: Checkout master branch
if: github.event_name == 'repository_dispatch' && github.event.action == 'new-release'
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Sync developer-edition branch
if: github.event_name == 'repository_dispatch' && github.event.action == 'new-release'
env:
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/sync-developer-edition-branch.sh"
- name: Checkout developer-edition branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: developer-edition
- name: Compare last tag to developer-edition head
id: step_compare
if: github.event_name != 'repository_dispatch'
shell: bash +e {0}
env:
TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
REPOSITORY: ${{ github.repository }}
HEAD_BRANCH_NAME: developer-edition
run: |
npm install --no-package-lock --no-save @octokit/core@3.4.0
LAST_DEV_TAG_NAME=$(node -p "require('./package.json').last_dev_version")
export BASE_TAG_NAME="v${LAST_DEV_TAG_NAME}"
node ./.github/scripts/compare-tag-to-branch.js
if [ $? -eq 0 ]; then
echo "::set-output name=cancel_workflow::1"
echo "CANCEL_WORKFLOW=1" >> $GITHUB_ENV
fi
- name: Bump version
id: bump_version_step
if: ${{ !env.CANCEL_WORKFLOW }}
run: |
npm install --no-package-lock --no-save semver@7.3.4
PREV_PACKAGE_VERSION=$(node -p "require('./package.json').last_dev_version")
NEW_PACKAGE_VERSION=$(node ./.github/scripts/update-prerelease-version.js dev)
PACKAGE_VERSION=$(node -p "require('./package.json').last_dev_version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
echo "::set-output name=prev_version::${PREV_PACKAGE_VERSION}"
- name: Push new version to developer-edition
if: ${{ !env.CANCEL_WORKFLOW }}
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/commit-push-bump.sh"
publish:
if: ${{ !needs.bump-version.outputs.cancel_workflow }}
needs: bump-version
runs-on: ubuntu-16.04
steps:
- name: Checkout developer-edition branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: developer-edition
- name: Install Dependencies
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').last_dev_version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
npm ci
- name: Build
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/update-version-elementor-php.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/build-zip.sh"
- name: Publish to WordPress.org SVN
env:
PLUGIN_VERSION: ${{ env.PACKAGE_VERSION }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-to-wordpress-org.sh"
- name: Upload zip file to GitHub actions artifact
uses: actions/upload-artifact@v2
with:
name: elementor-${{ env.PACKAGE_VERSION }}
path: ${{ github.workspace }}/elementor/**/*
if-no-files-found: error
- name: Create tag
env:
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/create-git-tag.sh"
- name: Generate changelog
env:
TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
REPOSITORY: ${{ github.repository }}
HEAD_BRANCH_NAME: v${{ env.PACKAGE_VERSION }}
BASE_TAG_NAME: v${{ needs.bump-version.outputs.prev_version }}
run: |
npm install --no-package-lock --no-save @octokit/core@3.4.0
node ./.github/scripts/generate-changelog.js
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.PACKAGE_VERSION }}
files: elementor-*.zip
prerelease: true
body_path: temp-changelog.txt
env:
GITHUB_TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
- name: Read changelog and set current date
run: |
CHANGELOG=$(cat temp-changelog.txt | tr -d '\n')
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "CHANGELOG=${CHANGELOG}" >> $GITHUB_ENV
echo "NOW=${NOW}" >> $GITHUB_ENV
- name: Parse Jira Keys from changelog
id: jira_keys
uses: HighwayThree/jira-extract-issue-keys@8050830121f3eab19553d2f0c0150873a8d1b51b
with:
commit-message: '${{ env.CHANGELOG }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push Deployment Info to Jira
if: steps.jira_keys.outputs.jira-keys != ''
uses: HighwayThree/jira-upload-deployment-info@7cd4db1e5cc96692fd0b4c688407efd95ae3e610
with:
client-id: '${{ secrets.JIRA_CLIENT_ID }}'
client-secret: '${{ secrets.JIRA_CLIENT_SECRET }}'
cloud-instance-base-url: '${{ secrets.JIRA_CLOUD_INSTANCE_BASE_URL }}'
issue-keys: "${{ steps.jira_keys.outputs.jira-keys }}"
display-name: "${{ env.PACKAGE_VERSION }}"
url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
description: "This PR was merged to the following release(s)"
last-updated: '${{ env.NOW }}'
state: 'successful'
pipeline-id: '${{ github.repository }} ${{ github.workflow }}'
pipeline-url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
environment-id: "${{ env.PACKAGE_VERSION }}"
environment-display-name: "${{ env.PACKAGE_VERSION }}"
environment-type: 'staging'
- name: Notify Slack
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNELS: ${{ secrets.SLACK_CHANNELS }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/slack-notify.sh"

View File

@@ -0,0 +1,176 @@
name: Publish Patch Version
on:
workflow_dispatch:
inputs:
canary:
description: 'Canary release (true/false)'
required: true
default: 'false'
jobs:
bump-version:
if: (github.actor == 'ronkelementor' || github.actor == 'KingYes') && startsWith(github.repository, 'elementor/')
runs-on: ubuntu-16.04
outputs:
prev_version: ${{ steps.bump_version_step.outputs.prev_version }}
steps:
- name: Checkout develop branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: develop
- name: Bump version
id: bump_version_step
run: |
npm config set git-tag-version false
PREV_PACKAGE_VERSION=$(node -p "require('./package.json').version")
npm version patch
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
echo "::set-output name=prev_version::${PREV_PACKAGE_VERSION}"
- name: Update readme.txt file
if: github.event.inputs.canary != 'true'
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/update-readme-stable-version.sh"
- name: Get beta tag
run: |
npm install --no-package-lock --no-save semver@7.3.4
BETA_TAG=$(node ./.github/scripts/get-beta-version.js)
echo "BETA_TAG=${BETA_TAG}" >> $GITHUB_ENV
- name: Add beta tag
if: ${{ env.BETA_TAG }}
env:
PACKAGE_VERSION: ${{ env.BETA_TAG }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/add-to-readme-beta-tag.sh"
- name: Check if readme.txt update
env:
VERSION: ${{ env.PACKAGE_VERSION }}
run: |
npm install --no-package-lock --no-save marked@2.0.6
node ./.github/scripts/get-changelog-from-readme-txt.js
- name: Push new version to develop
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/update-version-elementor-php.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/commit-push-bump.sh"
publish:
needs: bump-version
runs-on: ubuntu-16.04
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Merge develop -> master
uses: devmasx/merge-branch@a1752b9ba42bb417ec19be7dc974e2faf77d3ef2 # v1.3.1
with:
type: now
from_branch: develop
target_branch: master
github_token: ${{ secrets.MAINTAIN_TOKEN }}
- name: Checkout updated master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Install Dependencies
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
npm ci
- name: Build
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/build-zip.sh"
- name: Publish to WordPress.org SVN
env:
PLUGIN_VERSION: ${{ env.PACKAGE_VERSION }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-to-wordpress-org.sh"
- name: Upload zip file to GitHub actions artifact
uses: actions/upload-artifact@v2
with:
name: elementor-${{ env.PACKAGE_VERSION }}
path: ${{ github.workspace }}/elementor/**/*
- name: Create tag
env:
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/create-git-tag.sh"
- name: Generate changelog
env:
TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
REPOSITORY: ${{ github.repository }}
HEAD_BRANCH_NAME: v${{ env.PACKAGE_VERSION }}
BASE_TAG_NAME: v${{ needs.bump-version.outputs.prev_version }}
run: |
npm install --no-package-lock --no-save @octokit/core@3.4.0
node ./.github/scripts/generate-changelog.js
- name: Read changelog from readme.txt
env:
VERSION: ${{ env.PACKAGE_VERSION }}
run: |
npm install --no-package-lock --no-save marked@2.0.6
node ./.github/scripts/get-changelog-from-readme-txt.js
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.PACKAGE_VERSION }}
files: elementor-*.zip
body_path: temp-changelog-from-changelog.txt
env:
GITHUB_TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
- name: Read changelog and set current date
run: |
CHANGELOG=$(cat temp-changelog.txt | tr -d '\n')
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "CHANGELOG=${CHANGELOG}" >> $GITHUB_ENV
echo "NOW=${NOW}" >> $GITHUB_ENV
- name: Parse Jira Keys from changelog
id: jira_keys
uses: HighwayThree/jira-extract-issue-keys@8050830121f3eab19553d2f0c0150873a8d1b51b
with:
commit-message: '${{ env.CHANGELOG }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push Deployment Info to Jira
if: steps.jira_keys.outputs.jira-keys != ''
uses: HighwayThree/jira-upload-deployment-info@7cd4db1e5cc96692fd0b4c688407efd95ae3e610
with:
client-id: '${{ secrets.JIRA_CLIENT_ID }}'
client-secret: '${{ secrets.JIRA_CLIENT_SECRET }}'
cloud-instance-base-url: '${{ secrets.JIRA_CLOUD_INSTANCE_BASE_URL }}'
issue-keys: "${{ steps.jira_keys.outputs.jira-keys }}"
display-name: "${{ env.PACKAGE_VERSION }}"
url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
description: "This PR was merged to the following release(s)"
last-updated: '${{ env.NOW }}'
state: 'successful'
pipeline-id: '${{ github.repository }} ${{ github.workflow }}'
pipeline-url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
environment-id: "${{ env.PACKAGE_VERSION }}"
environment-display-name: "${{ env.PACKAGE_VERSION }}"
environment-type: 'production'
- name: Trigger developer-edition release
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
event-type: new-release
- name: Notify Slack
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNELS: ${{ secrets.SLACK_CHANNELS }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/slack-notify.sh"

View File

@@ -0,0 +1,194 @@
name: Publish Release Version
on:
workflow_dispatch:
inputs:
canary:
description: 'Canary release (true/false)'
required: true
default: 'false'
version:
description: 'Release branch version'
required: false
jobs:
merge-release-branch-to-develop:
if: (github.actor == 'ronkelementor' || github.actor == 'KingYes') && startsWith(github.repository, 'elementor/')
runs-on: ubuntu-16.04
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Get release branch
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/get-release-branch-name.sh"
- name: Checkout release branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: ${{ env.RELEASE_BRANCH }}
- name: Merge release -> develop
uses: devmasx/merge-branch@a1752b9ba42bb417ec19be7dc974e2faf77d3ef2 # v1.3.1
with:
type: now
from_branch: ${{ env.RELEASE_BRANCH }}
target_branch: develop
github_token: ${{ secrets.MAINTAIN_TOKEN }}
bump-version:
needs: merge-release-branch-to-develop
runs-on: ubuntu-16.04
outputs:
prev_version: ${{ steps.bump_version_step.outputs.prev_version }}
steps:
- name: Checkout develop branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: develop
- name: Bump version
id: bump_version_step
run: |
npm config set git-tag-version false
PREV_PACKAGE_VERSION=$(node -p "require('./package.json').version")
npm version minor
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
echo "::set-output name=prev_version::${PREV_PACKAGE_VERSION}"
- name: Update readme.txt file
if: github.event.inputs.canary != 'true'
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/remove-readme-beta-tag.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/update-readme-stable-version.sh"
- name: Check if readme.txt update
env:
VERSION: ${{ env.PACKAGE_VERSION }}
run: |
npm install --no-package-lock --no-save marked@2.0.6
node ./.github/scripts/get-changelog-from-readme-txt.js
- name: Push new version to develop
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/update-version-elementor-php.sh"
bash "${GITHUB_WORKSPACE}/.github/scripts/commit-push-bump.sh"
publish:
needs: bump-version
runs-on: ubuntu-16.04
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Merge develop -> master
uses: devmasx/merge-branch@a1752b9ba42bb417ec19be7dc974e2faf77d3ef2 # v1.3.1
with:
type: now
from_branch: develop
target_branch: master
github_token: ${{ secrets.MAINTAIN_TOKEN }}
- name: Checkout updated master branch
uses: actions/checkout@v2
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Install Dependencies
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
npm ci
- name: Build
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/build-zip.sh"
- name: Publish to WordPress.org SVN
env:
PLUGIN_VERSION: ${{ env.PACKAGE_VERSION }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/publish-to-wordpress-org.sh"
- name: Upload zip file to GitHub actions artifact
uses: actions/upload-artifact@v2
with:
name: elementor-${{ env.PACKAGE_VERSION }}
path: ${{ github.workspace }}/elementor/**/*
- name: Create tag
env:
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/create-git-tag.sh"
- name: Generate changelog
env:
TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
REPOSITORY: ${{ github.repository }}
HEAD_BRANCH_NAME: v${{ env.PACKAGE_VERSION }}
BASE_TAG_NAME: v${{ needs.bump-version.outputs.prev_version }}
run: |
npm install --no-package-lock --no-save @octokit/core@3.4.0
node ./.github/scripts/generate-changelog.js
- name: Read changelog from readme.txt
env:
VERSION: ${{ env.PACKAGE_VERSION }}
run: |
npm install --no-package-lock --no-save marked@2.0.6
node ./.github/scripts/get-changelog-from-readme-txt.js
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.PACKAGE_VERSION }}
files: elementor-*.zip
body_path: temp-changelog-from-changelog.txt
env:
GITHUB_TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
- name: Read changelog and set current date
run: |
CHANGELOG=$(cat temp-changelog.txt | tr -d '\n')
NOW=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "CHANGELOG=${CHANGELOG}" >> $GITHUB_ENV
echo "NOW=${NOW}" >> $GITHUB_ENV
- name: Parse Jira Keys from changelog
id: jira_keys
uses: HighwayThree/jira-extract-issue-keys@8050830121f3eab19553d2f0c0150873a8d1b51b
with:
commit-message: '${{ env.CHANGELOG }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push Deployment Info to Jira
if: steps.jira_keys.outputs.jira-keys != ''
uses: HighwayThree/jira-upload-deployment-info@7cd4db1e5cc96692fd0b4c688407efd95ae3e610
with:
client-id: '${{ secrets.JIRA_CLIENT_ID }}'
client-secret: '${{ secrets.JIRA_CLIENT_SECRET }}'
cloud-instance-base-url: '${{ secrets.JIRA_CLOUD_INSTANCE_BASE_URL }}'
issue-keys: "${{ steps.jira_keys.outputs.jira-keys }}"
display-name: "${{ env.PACKAGE_VERSION }}"
url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
description: "This PR was merged to the following release(s)"
last-updated: '${{ env.NOW }}'
state: 'successful'
pipeline-id: '${{ github.repository }} ${{ github.workflow }}'
pipeline-url: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
environment-id: "${{ env.PACKAGE_VERSION }}"
environment-display-name: "${{ env.PACKAGE_VERSION }}"
environment-type: 'production'
- name: Trigger developer-edition release
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.MAINTAIN_TOKEN }}
event-type: new-release
- name: Notify Slack
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNELS: ${{ secrets.SLACK_CHANNELS }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/slack-notify.sh"

View File

@@ -0,0 +1,40 @@
name: Elementor-ScreenShotter
on: [ push, pull_request ]
jobs:
run:
runs-on: ubuntu-16.04
timeout-minutes: 20
env:
screenshotter_config_path: ${{ github.workspace }}/tests/screenshotter/config.js
strategy:
fail-fast: false
matrix:
wordpress_versions: [ 'latest' ]
name: WordPress ${{ matrix.wordpress_versions }}
steps:
- name: Startup MySQL service
run: sudo /etc/init.d/mysql start
- name: Checkout source code
uses: actions/checkout@master
- name: Install Elementor-ScreenShotter
run: | ##### TO DO: Remove all sudo
sudo ln -sf /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
sudo chown -R $USER /usr/local/lib/node_modules
sudo chown -R $USER /usr/local/bin/
npm i -g @elementor/screenshotter
- name: Install Dependencies
run: |
elementor-screenshotter-install --config=${screenshotter_config_path} --debug=true
- name: Import Templates
run: |
elementor-screenshotter-import-templates --config=${screenshotter_config_path} --debug=true
- name: Build Package & Run Test
run: |
elementor-screenshotter-run-test --config=${screenshotter_config_path} --debug=true --deepDebug=true
- uses: actions/upload-artifact@master
if: failure()
with:
name: backstop-output
path: /tmp/wordpress/backstop_data

View File

@@ -0,0 +1,40 @@
name: Sync Branches
on:
workflow_dispatch:
schedule:
- cron: '0 */2 * * *'
jobs:
run:
runs-on: ubuntu-16.04
if: startsWith( github.repository, 'elementor/' )
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.MAINTAIN_TOKEN }}
ref: master
- name: Sync developer-edition branch
env:
MAINTAIN_EMAIL: ${{ secrets.MAINTAIN_EMAIL }}
MAINTAIN_USERNAME: ${{ secrets.MAINTAIN_USERNAME }}
run: |
bash "${GITHUB_WORKSPACE}/.github/scripts/sync-developer-edition-branch.sh"
- name: Sync feature branches into developer-edition branch
env:
TOKEN: ${{ secrets.MAINTAIN_TOKEN }}
REPOSITORY: ${{ github.repository }}
run: |
npm install --no-package-lock --no-save @octokit/core@3.3.1
node "${GITHUB_WORKSPACE}/.github/scripts/sync-features-branch-to-developer-branch.js"
- name: Notify slack on failure
if: failure()
env:
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CHANNEL: ${{ secrets.SLACK_SYNC_CHANNEL }}
SLACK_BOT_NAME: ElementorBot
run: |
MESSAGE_TEXT="@channel Repo: *$GITHUB_REPOSITORY* Workflow: *$GITHUB_WORKFLOW* is FAILED - <$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID|link>"
curl -X POST "https://slack.com/api/chat.postMessage" -d "username=${SLACK_BOT_NAME}&token=${SLACK_TOKEN}&channel=${SLACK_CHANNEL}&text=${MESSAGE_TEXT}&link_names=true"

View File

@@ -0,0 +1,25 @@
amitaigat
arielk
Aviad-Herman
avivu
bainternet
danielkatz
DorShahar
guyc-E
iNewLegend
ItzhakAvm
joshmarom
KingYes
kobizz
matipojo
Nevoss
nisan250
nuritsha
ronkelementor
rotemee
shilo-ey
StyleShit
Tomer-elementor
Tzvi-ka
udidol
yonatanelm