From 4f1fdce8a11045e564ac61fb635711d91e8f2630 Mon Sep 17 00:00:00 2001 From: icaparros-at-wiris Date: Thu, 19 Oct 2023 09:46:21 +0200 Subject: [PATCH] feat(wordpress): publish workflow to aws --- .github/workflows/publish-wordpress.yml | 50 +++++++++++++++++++++++++ .github/workflows/publish.yml | 47 ----------------------- 2 files changed, 50 insertions(+), 47 deletions(-) diff --git a/.github/workflows/publish-wordpress.yml b/.github/workflows/publish-wordpress.yml index 0b85395bb..11d0b96ff 100644 --- a/.github/workflows/publish-wordpress.yml +++ b/.github/workflows/publish-wordpress.yml @@ -15,4 +15,54 @@ on: Type `publish_aws` to do publish to S3, any other value otherwise. required: false default: "" + version: + description: | + Version number, e.g.: "8.5.0" + required: false + default: "" + +# Array of jobs to run in this workflow +jobs: + publish-wordpres: + runs-on: ubuntu-latest + + if: github.event.inputs.publish_aws == 'publish_aws' + + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + + # Install dependencies and create compiled files + - name: Build the JavaScript + run: | + yarn install + npx nx build wordpress + - name: Create Icons folder inside the build one + run: | + cp -a packages/wordpress/src/icons/ packages/wordpress/build/icons/ + + # Create a zip file with the files needed to integrate + # Mathtype for WordPress + - name: Zip integration + uses: vimtor/action-zip@v1 + with: + files: packages/wordpress/build/ VERSION + dest: mathtype-tinymce-wordpress_${{ github.event.inputs.version }}.zip + - uses: vimtor/action-zip@v1 + with: + files: packages/wordpress/src/tiny_mce_wiris.php + dest: wordpress-wiris_${{ github.event.inputs.version }}.zip + # Release WordPress plugin + - name: Release on GitHub + uses: marvinpinto/action-automatic-releases@latest + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + automatic_release_tag: "latest" + prerelease: true + title: "CI" + files: | + *.zip diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a46cac81c..387d2c47d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,50 +48,3 @@ jobs: # Call the script that interacts with the yarn CLI ./scripts/publish.mjs ${{ github.event.inputs.versions }} - - publish-wordpress: - runs-on: ubuntu-latest - - # If we want to publish the WordPress plugin, which is not needed on npm. - if: contains(github.event.inputs, 'wordpress') - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - name: Checkout - uses: actions/checkout@v2 - - # Install dependencies and create compiled files - - name: Build the JavaScript - run: | - yarn install - nx build wordpress - - name: Create Icons folder inside the build one - run: | - cp -a packages/wordpress/src/icons/ packages/wordpress/build/icons/ - - # Create a zip file with the files needed to integrate - # Mathtype for WordPress - - name: Zip integration - uses: vimtor/action-zip@v1 - with: - files: build/ VERSION - dest: "mathtype-tinymce-wordpress_${{ github.event.inputs.version }}.zip" - - uses: vimtor/action-zip@v1 - with: - files: wordpress-wiris-plugin/tiny_mce_wiris.php - dest: "wordpress-wiris_${{ github.event.inputs.version }}.zip" - - # Release WordPress plugin - - name: Release on GitHub - uses: marvinpinto/action-automatic-releases@latest - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - automatic_release_tag: "latest" - prerelease: true - title: "CI" - files: | - *.zip