From 7de2a84031e1ce19ab7ea4ddceafb3de7923f58d Mon Sep 17 00:00:00 2001 From: Maria Fernanda Magallanes Zubillaga Date: Tue, 3 Sep 2024 15:19:42 -0500 Subject: [PATCH 1/2] test: add the wordpress plugin check action --- .github/workflows/wordpress-plugin-check.yml | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/wordpress-plugin-check.yml diff --git a/.github/workflows/wordpress-plugin-check.yml b/.github/workflows/wordpress-plugin-check.yml new file mode 100644 index 0000000..767340a --- /dev/null +++ b/.github/workflows/wordpress-plugin-check.yml @@ -0,0 +1,27 @@ +name: 'WordPress Plugin Check' +on: + pull_request + +jobs: + check: + name: Plugin Check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Composer dependencies + uses: ramsey/composer-install@v3 + with: + composer-options: "--no-dev" + + # Prepare the plugin as we prepare it in the ZIP creation + - name: Create openedx-commerce directory and copy files + run: | + mkdir openedx-commerce + rsync -av --exclude='*.git*' --exclude='.*' --exclude='/test/*' --exclude='/requirements/*' --exclude='/docs/*' --exclude='composer.lock' --exclude='*.yaml' --exclude='*.xml' --exclude='Makefile' ./ openedx-commerce/ + + - name: Run plugin check + uses: wordpress/plugin-check-action@v1 + with: + build-dir: './openedx-commerce' From 649ad0bbf853281ce9790072eaf0def85345d6ec Mon Sep 17 00:00:00 2001 From: Maria Fernanda Magallanes Zubillaga Date: Thu, 5 Sep 2024 10:54:43 -0500 Subject: [PATCH 2/2] refactor: unify the process of create the openedx-commerce directory for the release --- .github/workflows/upload-release-zip.yml | 8 ++++++-- .github/workflows/wordpress-plugin-check.yml | 6 ++---- Makefile | 7 +++++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upload-release-zip.yml b/.github/workflows/upload-release-zip.yml index f4f5bca..805949b 100644 --- a/.github/workflows/upload-release-zip.yml +++ b/.github/workflows/upload-release-zip.yml @@ -19,12 +19,16 @@ jobs: with: composer-options: "--no-dev" + - name: Prepare the openedx-commerce directory for the release + run: | + make release + - name: Archive Release uses: thedoctor0/zip-release@0.7.6 with: type: 'zip' - filename: 'openedx-commerce.zip' - exclusions: '*.git* .* /test/* /requirements/* /docs/* composer.lock *.yaml *.xml Makefile' + command: 'cd ./openedx-commerce' + filename: '../openedx-commerce.zip' - name: Upload zip to latest release uses: xresloader/upload-to-github-release@v1 diff --git a/.github/workflows/wordpress-plugin-check.yml b/.github/workflows/wordpress-plugin-check.yml index 767340a..65186c2 100644 --- a/.github/workflows/wordpress-plugin-check.yml +++ b/.github/workflows/wordpress-plugin-check.yml @@ -15,11 +15,9 @@ jobs: with: composer-options: "--no-dev" - # Prepare the plugin as we prepare it in the ZIP creation - - name: Create openedx-commerce directory and copy files + - name: Prepare the openedx-commerce directory for the release run: | - mkdir openedx-commerce - rsync -av --exclude='*.git*' --exclude='.*' --exclude='/test/*' --exclude='/requirements/*' --exclude='/docs/*' --exclude='composer.lock' --exclude='*.yaml' --exclude='*.xml' --exclude='Makefile' ./ openedx-commerce/ + make release - name: Run plugin check uses: wordpress/plugin-check-action@v1 diff --git a/Makefile b/Makefile index 1c68427..68f2e9d 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,13 @@ requirements: serve_docs: ## serve the built docs locally to preview the site in the browser sphinx-autobuild docs/source $(BUILDDIR)/html +# Create the openedx-commerce directory with the needed files for the release. +release: + mkdir openedx-commerce + rsync -av --exclude='*.git*' --exclude='.*' --exclude='/test/*' \ + --exclude='/requirements/*' --exclude='/docs/*' --exclude='composer.lock' \ + --exclude='*.yaml' --exclude='*.xml' --exclude='Makefile' ./ openedx-commerce/ + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile