From 94be5480e11650355610a89b512ab13ce83f6957 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 28 Feb 2024 12:57:01 +0100 Subject: [PATCH 01/45] feat: declare workflow outputs from job outputs --- .github/workflows/build-plugin-archive.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index a0b79eea..2f73d909 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -72,6 +72,10 @@ on: ENV_VARS: description: Additional environment variables as a JSON formatted object. required: false + outputs: + artifact: + description: The name of the generated release artifact + value: ${{ jobs.create-plugin-archive.outputs.artifact }} jobs: create-plugin-archive: From e100109651a47963ee5e284b0d866966775e0b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 28 Feb 2024 13:33:49 +0100 Subject: [PATCH 02/45] Update to actions/upload-artifact@v4 --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 2f73d909..2d916d19 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -207,7 +207,7 @@ jobs: run: echo "artifact=${{ steps.plugin-data.outputs.archive-name }}" >> $GITHUB_OUTPUT - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ steps.set-artifact-name.outputs.artifact }} path: dist/* From 5a6722bac8839ae1509b1f182e913ff7de6828ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 10:58:01 +0100 Subject: [PATCH 03/45] Split into three jobs. --- .github/workflows/build-plugin-archive.yml | 80 +++++++++++++++------- 1 file changed, 55 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 2d916d19..dbbc0fde 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -25,7 +25,7 @@ on: type: string COMPOSER_ARGS: description: Set of arguments passed to Composer. - default: '--no-dev --no-scripts --prefer-dist --optimize-autoloader' + default: '--no-dev --prefer-dist --optimize-autoloader' required: false type: string PHP_VERSION: @@ -78,14 +78,12 @@ on: value: ${{ jobs.create-plugin-archive.outputs.artifact }} jobs: - create-plugin-archive: + checkout-dependencies: timeout-minutes: 5 runs-on: ubuntu-latest env: NODE_OPTIONS: ${{ inputs.NODE_OPTIONS }} NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} - NODE_CACHE_MODE: '' - ARCHIVE_NAME: ${{ inputs.ARCHIVE_NAME }} PLUGIN_FOLDER_NAME: ${{ inputs.PLUGIN_FOLDER_NAME }} ENV_VARS: ${{ secrets.ENV_VARS }} GIT_SHA: ${{ github.sha }} @@ -118,28 +116,40 @@ jobs: .parse(process.env.ENV_VARS) .forEach(envVar => core.exportVariable(envVar.name, envVar.value)); - - name: Set up node cache mode - run: | - if [ "${{ inputs.PACKAGE_MANAGER }}" == 'npm' ] && { [ -f "${GITHUB_WORKSPACE}/package-lock.json" ] || [ -f "${GITHUB_WORKSPACE}/npm-shrinkwrap.json" ]; }; then - echo "NODE_CACHE_MODE=npm" >> $GITHUB_ENV - elif [ "${{ inputs.PACKAGE_MANAGER }}" == 'yarn' ] && [ -f "${GITHUB_WORKSPACE}/yarn.lock" ]; then - echo "NODE_CACHE_MODE=yarn" >> $GITHUB_ENV - else - echo "No lock files found or unknown package manager" - fi - - name: Set up PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ inputs.PHP_VERSION }} tools: wp-cli - - name: Install Composer dependencies - # ⬑ The idea is to ensure we have non-production tools like Composer Asset Compiler and WordPress Translation Downloader available + - name: Install Composer dependencies without dev dependencies uses: ramsey/composer-install@v2 with: - composer-options: --prefer-dist + composer-options: ${{ inputs.COMPOSER_ARGS }} + - name: Set artifact name + id: set-artifact-name + run: echo "artifact=${{ steps.plugin-data.outputs.archive-name }}" >> $GITHUB_OUTPUT + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ steps.set-artifact-name.outputs.artifact }} + path: dist/* + run-build-tools: + timeout-minutes: 5 + runs-on: ubuntu-latest + env: + NODE_OPTIONS: ${{ inputs.NODE_OPTIONS }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} + NODE_CACHE_MODE: '' + outputs: + artifact: ${{ steps.set-artifact-name.outputs.artifact }} + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: ${{ needs.checkout-dependencies.outputs.artifact }} - name: Check optional Composer build tools id: composer-tools run: | @@ -151,6 +161,16 @@ jobs: echo "assets-compiler=$( hasDep inpsyde/composer-assets-compiler )" >> $GITHUB_OUTPUT echo "translation-downloader=$( hasDep inpsyde/wp-translation-downloader )" >> $GITHUB_OUTPUT + - name: Set up node cache mode + run: | + if [ "${{ inputs.PACKAGE_MANAGER }}" == 'npm' ] && { [ -f "${GITHUB_WORKSPACE}/package-lock.json" ] || [ -f "${GITHUB_WORKSPACE}/npm-shrinkwrap.json" ]; }; then + echo "NODE_CACHE_MODE=npm" >> $GITHUB_ENV + elif [ "${{ inputs.PACKAGE_MANAGER }}" == 'yarn' ] && [ -f "${GITHUB_WORKSPACE}/yarn.lock" ]; then + echo "NODE_CACHE_MODE=yarn" >> $GITHUB_ENV + else + echo "No lock files found or unknown package manager" + fi + - name: Check for package.json id: check-for-package run: | @@ -175,13 +195,24 @@ jobs: - name: Run WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' run: composer wp-translation-downloader:download - - - name: Install Composer dependencies without dev dependencies - # ⬑ Now we want to get rid of dev dependencies and most probably skip composer scripts - uses: ramsey/composer-install@v2 + - name: Set artifact name + id: set-artifact-name + run: echo "artifact=${{ needs.checkout-dependencies.outputs.artifact }}-built" >> $GITHUB_OUTPUT + - name: Upload artifact + uses: actions/upload-artifact@v4 with: - composer-options: ${{ inputs.COMPOSER_ARGS }} - + name: ${{ needs.create_archive.outputs.artifact }}-dist + path: . + create-plugin-archive: + timeout-minutes: 5 + runs-on: ubuntu-latest + env: + ARCHIVE_NAME: ${{ inputs.ARCHIVE_NAME }} + steps: + - name: Download Artifact + uses: actions/download-artifact@v4 + with: + name: ${{ needs.checkout-dependencies.outputs.artifact }} - name: Add commit hash to plugin header run: 'sed -Ei "s/SHA: .*/SHA: ${GIT_SHA}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' @@ -193,7 +224,7 @@ jobs: - name: Execute custom code before archive creation run: | - ${{ inputs.PRE_SCRIPT }} + ${{ inputs.PRE_SCRIPT }} - name: Run WP-CLI command run: wp dist-archive . ./archive.zip --plugin-dirname=${{ steps.plugin-folder-name.outputs.plugin-folder-name }} @@ -210,4 +241,3 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ steps.set-artifact-name.outputs.artifact }} - path: dist/* From fe7f453900a2b3f297057e39f5c83d49fbecfb73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 13:07:36 +0100 Subject: [PATCH 04/45] Set up job dependencies --- .github/workflows/build-plugin-archive.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index dbbc0fde..626ffe99 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -139,6 +139,7 @@ jobs: run-build-tools: timeout-minutes: 5 runs-on: ubuntu-latest + needs: checkout-dependencies env: NODE_OPTIONS: ${{ inputs.NODE_OPTIONS }} NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} @@ -206,6 +207,7 @@ jobs: create-plugin-archive: timeout-minutes: 5 runs-on: ubuntu-latest + needs: run-build-tools env: ARCHIVE_NAME: ${{ inputs.ARCHIVE_NAME }} steps: From 852ecfd08658e654ba40ff5720ec5b07b632c21d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 13:11:18 +0100 Subject: [PATCH 05/45] Fix upload directory --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 626ffe99..8d7b136e 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -135,7 +135,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ steps.set-artifact-name.outputs.artifact }} - path: dist/* + path: ./* run-build-tools: timeout-minutes: 5 runs-on: ubuntu-latest From a6ed28260a9d5ab008dea1104ac3448ef13f4366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 14:04:51 +0100 Subject: [PATCH 06/45] Test for build tool configs --- .github/workflows/build-plugin-archive.yml | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 8d7b136e..76fee1df 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -154,13 +154,29 @@ jobs: - name: Check optional Composer build tools id: composer-tools run: | + hasAssetConfig(){ + test -f assets-compiler.json + local EXIT=$? + if [ ! $EXIT ]; then + echo "$EXIT" + exit 0 + fi + jq '.extra | has("composer-asset-compiler")' < composer.json >/dev/null 2>&1 + local EXIT=$? + echo "$EXIT" + } + hasTranslateConfig(){ + jq '.extra | has("wp-translation-downloader")' < composer.json >/dev/null 2>&1 + local EXIT=$? + echo "$EXIT" + } hasDep(){ composer show -i -N -D --strict "${1}" >/dev/null 2>&1 local EXIT=$? echo "$EXIT" } - echo "assets-compiler=$( hasDep inpsyde/composer-assets-compiler )" >> $GITHUB_OUTPUT - echo "translation-downloader=$( hasDep inpsyde/wp-translation-downloader )" >> $GITHUB_OUTPUT + echo "assets-compiler=$( hasAssetConfig )" >> $GITHUB_OUTPUT + echo "translation-downloader=$( hasTranslateConfig )" >> $GITHUB_OUTPUT - name: Set up node cache mode run: | @@ -189,13 +205,20 @@ jobs: registry-url: ${{ inputs.NPM_REGISTRY_DOMAIN }} cache: ${{ env.NODE_CACHE_MODE }} + - name: Install Composer Asset Compiler + if: steps.composer-tools.outputs.assets-compiler == '0' && steps.check-for-package.outputs.has_package == 'true' + run: composer global require inpsyde/composer-assets-compiler - name: Run Composer Asset Compiler if: steps.composer-tools.outputs.assets-compiler == '0' && steps.check-for-package.outputs.has_package == 'true' run: composer compile-assets ${{ inputs.COMPILE_ASSETS_ARGS }} + - name: Install WordPress Translation Downloader + if: steps.composer-tools.outputs.translation-downloader == '0' + run: composer global require inpsyde/wp-translation-downloader - name: Run WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' run: composer wp-translation-downloader:download + - name: Set artifact name id: set-artifact-name run: echo "artifact=${{ needs.checkout-dependencies.outputs.artifact }}-built" >> $GITHUB_OUTPUT From 77b17d8bcfc36c2d96e16d66acebf104b1a9f652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 14:08:04 +0100 Subject: [PATCH 07/45] Improve artifact naming --- .github/workflows/build-plugin-archive.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 76fee1df..67fc76a3 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -129,7 +129,7 @@ jobs: - name: Set artifact name id: set-artifact-name - run: echo "artifact=${{ steps.plugin-data.outputs.archive-name }}" >> $GITHUB_OUTPUT + run: echo "artifact=${{ steps.plugin-data.outputs.archive-name }}-deps" >> $GITHUB_OUTPUT - name: Upload artifact uses: actions/upload-artifact@v4 @@ -225,7 +225,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: ${{ needs.create_archive.outputs.artifact }}-dist + name: ${{ steps.set-artifact-name.outputs.artifact }} path: . create-plugin-archive: timeout-minutes: 5 @@ -237,7 +237,7 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 with: - name: ${{ needs.checkout-dependencies.outputs.artifact }} + name: ${{ needs.run-build-tools.outputs.artifact }} - name: Add commit hash to plugin header run: 'sed -Ei "s/SHA: .*/SHA: ${GIT_SHA}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' From 134d06313df0ad8e5d91657178998c948ecc4da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 14:16:18 +0100 Subject: [PATCH 08/45] Allow composer plugins prior to installation --- .github/workflows/build-plugin-archive.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 67fc76a3..1350912a 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -207,14 +207,18 @@ jobs: - name: Install Composer Asset Compiler if: steps.composer-tools.outputs.assets-compiler == '0' && steps.check-for-package.outputs.has_package == 'true' - run: composer global require inpsyde/composer-assets-compiler + run: | + composer global config --no-plugins allow-plugins.inpsyde/composer-assets-compiler + composer global require inpsyde/composer-assets-compiler - name: Run Composer Asset Compiler if: steps.composer-tools.outputs.assets-compiler == '0' && steps.check-for-package.outputs.has_package == 'true' run: composer compile-assets ${{ inputs.COMPILE_ASSETS_ARGS }} - name: Install WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' - run: composer global require inpsyde/wp-translation-downloader + run: | + composer global config --no-plugins allow-plugins.inpsyde/wp-translation-downloader + composer global require inpsyde/wp-translation-downloader - name: Run WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' run: composer wp-translation-downloader:download From 9a552966a13efb46a367219c4a30a205e9f0361d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 14:23:11 +0100 Subject: [PATCH 09/45] Allow composer plugins prior to installation --- .github/workflows/build-plugin-archive.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 1350912a..acaa7973 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -208,7 +208,7 @@ jobs: - name: Install Composer Asset Compiler if: steps.composer-tools.outputs.assets-compiler == '0' && steps.check-for-package.outputs.has_package == 'true' run: | - composer global config --no-plugins allow-plugins.inpsyde/composer-assets-compiler + composer global config --no-plugins --no-interaction allow-plugins.inpsyde/composer-assets-compiler true composer global require inpsyde/composer-assets-compiler - name: Run Composer Asset Compiler if: steps.composer-tools.outputs.assets-compiler == '0' && steps.check-for-package.outputs.has_package == 'true' @@ -217,7 +217,7 @@ jobs: - name: Install WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' run: | - composer global config --no-plugins allow-plugins.inpsyde/wp-translation-downloader + composer global config --no-plugins --no-interaction allow-plugins.inpsyde/wp-translation-downloader true composer global require inpsyde/wp-translation-downloader - name: Run WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' From b69e951210703b04571ffd19d797ef16f0a9ab00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 14:25:23 +0100 Subject: [PATCH 10/45] Allow composer plugins prior to installation --- .github/workflows/build-plugin-archive.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index acaa7973..9d48f7d1 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -217,6 +217,7 @@ jobs: - name: Install WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' run: | + composer global config --no-plugins --no-interaction allow-plugins.composer/installers true composer global config --no-plugins --no-interaction allow-plugins.inpsyde/wp-translation-downloader true composer global require inpsyde/wp-translation-downloader - name: Run WordPress Translation Downloader From d16d060c54a90c9effcb9b467887f0690a271ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 14:34:42 +0100 Subject: [PATCH 11/45] Set up php for wp-cli --- .github/workflows/build-plugin-archive.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 9d48f7d1..40b2a3da 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -249,6 +249,12 @@ jobs: - name: Set plugin version header run: 'sed -Ei "s/Version: .*/Version: ${PLUGIN_VERSION}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + tools: wp-cli + - name: Install dist-archive command run: wp package install wp-cli/dist-archive-command From 102504aedae7e9b09c4b39902a9a93b8bd8d1872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 14:36:29 +0100 Subject: [PATCH 12/45] remove some clutter from deps artifact already --- .github/workflows/build-plugin-archive.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 40b2a3da..79900f1f 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -135,7 +135,10 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ steps.set-artifact-name.outputs.artifact }} - path: ./* + path: | + ./* + !./.git + !./.ddev run-build-tools: timeout-minutes: 5 runs-on: ubuntu-latest From 1078279a7228989b59dfe52e3a9353dc1c5eed38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 15:18:16 +0100 Subject: [PATCH 13/45] improve artifact naming --- .github/workflows/build-plugin-archive.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 79900f1f..ec85a484 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -99,9 +99,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up archive name - id: plugin-data - run: echo "archive-name=${ARCHIVE_NAME:-${{ github.event.repository.name }}}" >> $GITHUB_OUTPUT + - name: Set up plugin folder name id: plugin-folder-name @@ -129,7 +127,7 @@ jobs: - name: Set artifact name id: set-artifact-name - run: echo "artifact=${{ steps.plugin-data.outputs.archive-name }}-deps" >> $GITHUB_OUTPUT + run: echo "artifact=interim-deps" >> $GITHUB_OUTPUT - name: Upload artifact uses: actions/upload-artifact@v4 @@ -139,6 +137,7 @@ jobs: ./* !./.git !./.ddev + !./.github run-build-tools: timeout-minutes: 5 runs-on: ubuntu-latest @@ -229,12 +228,14 @@ jobs: - name: Set artifact name id: set-artifact-name - run: echo "artifact=${{ needs.checkout-dependencies.outputs.artifact }}-built" >> $GITHUB_OUTPUT + run: echo "artifact=interim-built" >> $GITHUB_OUTPUT - name: Upload artifact uses: actions/upload-artifact@v4 with: name: ${{ steps.set-artifact-name.outputs.artifact }} - path: . + path: | + . + !**/node_modules create-plugin-archive: timeout-minutes: 5 runs-on: ubuntu-latest @@ -246,6 +247,11 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ needs.run-build-tools.outputs.artifact }} + + - name: Set up archive name + id: plugin-data + run: echo "archive-name=${ARCHIVE_NAME:-${{ github.event.repository.name }}}" >> $GITHUB_OUTPUT + - name: Add commit hash to plugin header run: 'sed -Ei "s/SHA: .*/SHA: ${GIT_SHA}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' From 5c8b9fa2712c1806c0262eb30baec67a61cd18d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 15:20:40 +0100 Subject: [PATCH 14/45] Move required data for final archive step --- .github/workflows/build-plugin-archive.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index ec85a484..38129e2e 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -82,8 +82,6 @@ jobs: timeout-minutes: 5 runs-on: ubuntu-latest env: - NODE_OPTIONS: ${{ inputs.NODE_OPTIONS }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} PLUGIN_FOLDER_NAME: ${{ inputs.PLUGIN_FOLDER_NAME }} ENV_VARS: ${{ secrets.ENV_VARS }} GIT_SHA: ${{ github.sha }} @@ -99,12 +97,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - - - name: Set up plugin folder name - id: plugin-folder-name - run: echo "plugin-folder-name=${PLUGIN_FOLDER_NAME:-${ARCHIVE_NAME:-${{ github.event.repository.name }}}}" >> $GITHUB_OUTPUT - - name: Set up custom environment variables if: ${{ env.ENV_VARS }} uses: actions/github-script@v7 @@ -248,6 +240,10 @@ jobs: with: name: ${{ needs.run-build-tools.outputs.artifact }} + - name: Set up plugin folder name + id: plugin-folder-name + run: echo "plugin-folder-name=${PLUGIN_FOLDER_NAME:-${ARCHIVE_NAME:-${{ github.event.repository.name }}}}" >> $GITHUB_OUTPUT + - name: Set up archive name id: plugin-data run: echo "archive-name=${ARCHIVE_NAME:-${{ github.event.repository.name }}}" >> $GITHUB_OUTPUT From 520353b0a6e5b381418e9f366598ce7bca7c2993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 15:25:21 +0100 Subject: [PATCH 15/45] Add missing path config for final artifact upload --- .github/workflows/build-plugin-archive.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 38129e2e..9efcd980 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -79,6 +79,7 @@ on: jobs: checkout-dependencies: + name: Install production dependencies timeout-minutes: 5 runs-on: ubuntu-latest env: @@ -131,6 +132,7 @@ jobs: !./.ddev !./.github run-build-tools: + name: Process build steps timeout-minutes: 5 runs-on: ubuntu-latest needs: checkout-dependencies @@ -229,6 +231,7 @@ jobs: . !**/node_modules create-plugin-archive: + name: Create build archive timeout-minutes: 5 runs-on: ubuntu-latest needs: run-build-tools @@ -282,3 +285,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ steps.set-artifact-name.outputs.artifact }} + path: ./dist/* From c6153537513173d74069ea93675f3aec59963a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 19 Mar 2024 16:05:08 +0100 Subject: [PATCH 16/45] Move env vars where they belong --- .github/workflows/build-plugin-archive.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 9efcd980..86116c02 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -85,8 +85,6 @@ jobs: env: PLUGIN_FOLDER_NAME: ${{ inputs.PLUGIN_FOLDER_NAME }} ENV_VARS: ${{ secrets.ENV_VARS }} - GIT_SHA: ${{ github.sha }} - PLUGIN_VERSION: ${{ inputs.PLUGIN_VERSION }} COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_JSON }}' # Disables symlinking of local path repositories. # During development, symlinking is preferable. @@ -237,6 +235,8 @@ jobs: needs: run-build-tools env: ARCHIVE_NAME: ${{ inputs.ARCHIVE_NAME }} + GIT_SHA: ${{ github.sha }} + PLUGIN_VERSION: ${{ inputs.PLUGIN_VERSION }} steps: - name: Download Artifact uses: actions/download-artifact@v4 From 607a5e2622024711738eb970df9eb2c80a30760f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 20 Mar 2024 10:18:07 +0100 Subject: [PATCH 17/45] Move PLUGIN_FOLDER_NAME as well --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index cfd3fad5..25d37ec5 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -83,7 +83,6 @@ jobs: timeout-minutes: 5 runs-on: ubuntu-latest env: - PLUGIN_FOLDER_NAME: ${{ inputs.PLUGIN_FOLDER_NAME }} ENV_VARS: ${{ secrets.ENV_VARS }} COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_JSON }}' # Disables symlinking of local path repositories. @@ -235,6 +234,7 @@ jobs: needs: run-build-tools env: ARCHIVE_NAME: ${{ inputs.ARCHIVE_NAME }} + PLUGIN_FOLDER_NAME: ${{ inputs.PLUGIN_FOLDER_NAME }} GIT_SHA: ${{ github.sha }} PLUGIN_VERSION: ${{ inputs.PLUGIN_VERSION }} steps: From 9206bd84fa58466f75849683ca89990aae998018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 20 Mar 2024 14:21:53 +0100 Subject: [PATCH 18/45] Introduce php-scoper --- .github/workflows/build-plugin-archive.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 25d37ec5..32aa1f02 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -163,13 +163,14 @@ jobs: local EXIT=$? echo "$EXIT" } - hasDep(){ - composer show -i -N -D --strict "${1}" >/dev/null 2>&1 + hasScoperConfig(){ + test -f scoper.inc.php local EXIT=$? echo "$EXIT" } echo "assets-compiler=$( hasAssetConfig )" >> $GITHUB_OUTPUT echo "translation-downloader=$( hasTranslateConfig )" >> $GITHUB_OUTPUT + echo "php-scoper=$( hasScoperConfig )" >> $GITHUB_OUTPUT - name: Set up node cache mode run: | @@ -217,6 +218,19 @@ jobs: if: steps.composer-tools.outputs.translation-downloader == '0' run: composer wp-translation-downloader:download + - name: Install PHP Scoper + if: steps.composer-tools.outputs.php-scoper == '0' + run: | + composer global require humbug/php-scoper + - name: Run PHP Scoper + if: steps.composer-tools.outputs.php-scoper == '0' + run: | + "$(composer global config bin-dir --absolute --quiet)/php-scoper add-prefix --force --output-dir build" + composer --working-dir=build dump-autoload -o + - name: Move unchanged code to build directory + if: steps.composer-tools.outputs.php-scoper != '0' + run: mv * build 2>/dev/null + - name: Set artifact name id: set-artifact-name run: echo "artifact=interim-built" >> $GITHUB_OUTPUT @@ -225,8 +239,8 @@ jobs: with: name: ${{ steps.set-artifact-name.outputs.artifact }} path: | - . - !**/node_modules + build/ + !build/**/node_modules create-plugin-archive: name: Create build archive timeout-minutes: 5 From 7ecaeba67e337cb3326fabce6161afdef4365356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 20 Mar 2024 14:42:30 +0100 Subject: [PATCH 19/45] Introduce php-scoper via shivammathur/setup-php --- .github/workflows/build-plugin-archive.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 32aa1f02..4d1319bb 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -144,6 +144,11 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ needs.checkout-dependencies.outputs.artifact }} + - name: Setup PHP with tools + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + tools: humbug/php-scoper - name: Check optional Composer build tools id: composer-tools run: | @@ -218,14 +223,10 @@ jobs: if: steps.composer-tools.outputs.translation-downloader == '0' run: composer wp-translation-downloader:download - - name: Install PHP Scoper - if: steps.composer-tools.outputs.php-scoper == '0' - run: | - composer global require humbug/php-scoper - name: Run PHP Scoper if: steps.composer-tools.outputs.php-scoper == '0' run: | - "$(composer global config bin-dir --absolute --quiet)/php-scoper add-prefix --force --output-dir build" + php-scoper add-prefix --force --output-dir build composer --working-dir=build dump-autoload -o - name: Move unchanged code to build directory if: steps.composer-tools.outputs.php-scoper != '0' From 2451d0e833816c8f4d210fd20cc8844b187d522f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 21 Mar 2024 15:05:38 +0100 Subject: [PATCH 20/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 25d37ec5..a854a499 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -163,11 +163,6 @@ jobs: local EXIT=$? echo "$EXIT" } - hasDep(){ - composer show -i -N -D --strict "${1}" >/dev/null 2>&1 - local EXIT=$? - echo "$EXIT" - } echo "assets-compiler=$( hasAssetConfig )" >> $GITHUB_OUTPUT echo "translation-downloader=$( hasTranslateConfig )" >> $GITHUB_OUTPUT From 8839d577bcbb612b0cc07e924036ab2229fae1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 21 Mar 2024 15:06:28 +0100 Subject: [PATCH 21/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index a854a499..65bd460c 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -193,14 +193,12 @@ jobs: registry-url: ${{ inputs.NPM_REGISTRY_DOMAIN }} cache: ${{ env.NODE_CACHE_MODE }} - - name: Install Composer Asset Compiler - if: steps.composer-tools.outputs.assets-compiler == '0' && steps.check-for-package.outputs.has_package == 'true' + - name: Install and run Composer Asset Compiler + if: steps.composer-tools.outputs.assets-compiler == '0' run: | composer global config --no-plugins --no-interaction allow-plugins.inpsyde/composer-assets-compiler true composer global require inpsyde/composer-assets-compiler - - name: Run Composer Asset Compiler - if: steps.composer-tools.outputs.assets-compiler == '0' && steps.check-for-package.outputs.has_package == 'true' - run: composer compile-assets ${{ inputs.COMPILE_ASSETS_ARGS }} + composer compile-assets ${{ inputs.COMPILE_ASSETS_ARGS }} - name: Install WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' From 251fea61e4c4f6d391023d72093935277b9e1377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 21 Mar 2024 15:06:36 +0100 Subject: [PATCH 22/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 65bd460c..5032f40b 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -200,15 +200,13 @@ jobs: composer global require inpsyde/composer-assets-compiler composer compile-assets ${{ inputs.COMPILE_ASSETS_ARGS }} - - name: Install WordPress Translation Downloader + - name: Install and run WordPress Translation Downloader if: steps.composer-tools.outputs.translation-downloader == '0' run: | composer global config --no-plugins --no-interaction allow-plugins.composer/installers true composer global config --no-plugins --no-interaction allow-plugins.inpsyde/wp-translation-downloader true composer global require inpsyde/wp-translation-downloader - - name: Run WordPress Translation Downloader - if: steps.composer-tools.outputs.translation-downloader == '0' - run: composer wp-translation-downloader:download + composer wp-translation-downloader:download - name: Set artifact name id: set-artifact-name From 058508ee48c16e0c3c73cd5a826dc2c9a3522514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 21 Mar 2024 15:15:59 +0100 Subject: [PATCH 23/45] Introduce PHP_VERSION_BUILD --- .github/workflows/build-plugin-archive.yml | 11 ++++++++--- docs/archive-creation.md | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 5032f40b..9397e665 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -24,12 +24,17 @@ on: required: false type: string COMPOSER_ARGS: - description: Set of arguments passed to Composer. + description: Set of arguments passed to Composer when gathering production dependencies. default: '--no-dev --prefer-dist --optimize-autoloader' required: false type: string PHP_VERSION: - description: PHP version to use during packaging. + description: PHP version to use when gathering production dependencies. + default: "8.0" + required: false + type: string + PHP_VERSION_BUILD: + description: PHP version to use when executing build tools. default: "8.0" required: false type: string @@ -251,7 +256,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ inputs.PHP_VERSION_BUILD }} tools: wp-cli - name: Install dist-archive command diff --git a/docs/archive-creation.md b/docs/archive-creation.md index d99d96d6..1d8c21f3 100644 --- a/docs/archive-creation.md +++ b/docs/archive-creation.md @@ -46,7 +46,8 @@ jobs: | `NPM_REGISTRY_DOMAIN` | `"https://npm.pkg.github.com/"` | Domain of the private npm registry | | `PACKAGE_MANAGER` | `"yarn"` | Package manager with which the dependencies should be installed (`npm` or `yarn`) | | `COMPOSER_ARGS` | `'--no-dev --no-scripts --prefer-dist --optimize-autoloader'` | Set of arguments passed to Composer | -| `PHP_VERSION` | `"8.0"` | PHP version to use during packaging | +| `PHP_VERSION` | `"8.0"` | PHP version to use when gathering production dependencies | +| `PHP_VERSION_BUILD` | `"8.0"` | PHP version to use when executing build tools | | `ARCHIVE_NAME` | `""` | The name of the zip archive (falls back to the repository name) | | `PLUGIN_MAIN_FILE` | `"index.php"` | The name of the main plugin file | | `PLUGIN_FOLDER_NAME` | `""` | The name of the plugin folder (falls back to the archive name, if set, or the repository name) | From c59e12e3e61edb19b0db5341c4a980ce98b8e31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 21 Mar 2024 15:17:34 +0100 Subject: [PATCH 24/45] Remove somewhat redundant check for package.json files --- .github/workflows/build-plugin-archive.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 9397e665..0d328f14 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -181,17 +181,8 @@ jobs: echo "No lock files found or unknown package manager" fi - - name: Check for package.json - id: check-for-package - run: | - if [ -f package.json ]; then - echo "has_package=true" >> $GITHUB_OUTPUT - else - echo "has_package=false" >> $GITHUB_OUTPUT - fi - - name: Set up node - if: steps.check-for-package.outputs.has_package == 'true' + if: steps.composer-tools.outputs.assets-compiler == '0' uses: actions/setup-node@v4 with: node-version: ${{ inputs.NODE_VERSION }} From 5019427ebeba4e78d763bcbb4410f07e4333b446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Thu, 21 Mar 2024 15:25:46 +0100 Subject: [PATCH 25/45] Merge upstream changes and fix required php version --- .github/workflows/build-plugin-archive.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 1463a70f..3d004274 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -35,7 +35,7 @@ on: type: string PHP_VERSION_BUILD: description: PHP version to use when executing build tools. - default: "8.0" + default: "8.2" required: false type: string ARCHIVE_NAME: @@ -152,7 +152,7 @@ jobs: - name: Setup PHP with tools uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: ${{ inputs.PHP_VERSION_BUILD }} tools: humbug/php-scoper - name: Check optional Composer build tools id: composer-tools From 946f4e425080eb9ab598334e8f0d2867f55d3960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 30 Apr 2024 11:54:15 +0200 Subject: [PATCH 26/45] temporarily require main branch of php-scoper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 3d004274..4da6ae37 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -153,7 +153,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ inputs.PHP_VERSION_BUILD }} - tools: humbug/php-scoper + tools: humbug/php-scoper:dev-main - name: Check optional Composer build tools id: composer-tools run: | From 81bc4447a5035ea39590565d01d18c5acdf5309e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 18 Jun 2024 15:21:55 +0200 Subject: [PATCH 27/45] Force '__composer_autoload_files' to be unique MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 4da6ae37..d8a60bcf 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -220,6 +220,7 @@ jobs: run: | php-scoper add-prefix --force --output-dir build composer --working-dir=build dump-autoload -o + sed -i "s/'__composer_autoload_files'/\'__composer_autoload_${{ steps.plugin-data.outputs.archive-name }}'/g" "vendor/composer/autoload_real.php" - name: Move unchanged code to build directory if: steps.composer-tools.outputs.php-scoper != '0' run: mv * build 2>/dev/null From a78738ab8083faddb45b200e73eb912cbd77201f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 18 Jun 2024 15:40:48 +0200 Subject: [PATCH 28/45] Use github.sha for now MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index d8a60bcf..47e37444 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -220,7 +220,7 @@ jobs: run: | php-scoper add-prefix --force --output-dir build composer --working-dir=build dump-autoload -o - sed -i "s/'__composer_autoload_files'/\'__composer_autoload_${{ steps.plugin-data.outputs.archive-name }}'/g" "vendor/composer/autoload_real.php" + sed -i "s/'__composer_autoload_files'/\'__composer_autoload_${{ github.sha }}'/g" "vendor/composer/autoload_real.php" - name: Move unchanged code to build directory if: steps.composer-tools.outputs.php-scoper != '0' run: mv * build 2>/dev/null From b20f5ad81933d6300fce9113d3d2e609a4ba123a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 18 Jun 2024 15:50:36 +0200 Subject: [PATCH 29/45] One more try MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 47e37444..10b7f3ca 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -220,7 +220,7 @@ jobs: run: | php-scoper add-prefix --force --output-dir build composer --working-dir=build dump-autoload -o - sed -i "s/'__composer_autoload_files'/\'__composer_autoload_${{ github.sha }}'/g" "vendor/composer/autoload_real.php" + sed -i "s/'__composer_autoload_files'/\'__composer_autoload_files_${{ github.sha }}'/g" "build/vendor/composer/autoload_real.php" - name: Move unchanged code to build directory if: steps.composer-tools.outputs.php-scoper != '0' run: mv * build 2>/dev/null From 4ca3067d6c3165d71edc3a57b0bd2b0e74bac535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Mon, 24 Jun 2024 13:18:02 +0200 Subject: [PATCH 30/45] Fix usage of artifact name --- .github/workflows/build-plugin-archive.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 5b77d5b5..b26ae667 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -258,11 +258,11 @@ jobs: run: echo "archive-name=${ARCHIVE_NAME:-${{ github.event.repository.name }}}" >> $GITHUB_OUTPUT - name: Add commit hash to plugin header - working-directory: interim-deps + working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: 'sed -Ei "s/SHA: .*/SHA: ${GIT_SHA}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' - name: Set plugin version header - working-directory: interim-deps + working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: 'sed -Ei "s/Version: .*/Version: ${PLUGIN_VERSION}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' - name: Set up PHP @@ -275,12 +275,13 @@ jobs: run: wp package install wp-cli/dist-archive-command - name: Execute custom code before archive creation + working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: | ${{ inputs.PRE_SCRIPT }} - name: Run WP-CLI command run: | - wp dist-archive ./interim-deps ./archive.zip --plugin-dirname=${{ steps.plugin-folder-name.outputs.plugin-folder-name }} + wp dist-archive ./${{ needs.run-build-tools.outputs.artifact }} ./archive.zip --plugin-dirname=${{ steps.plugin-folder-name.outputs.plugin-folder-name }} # GitHub Action artifacts would otherwise produce a zip within a zip - name: Unzip archive to dist/ From df4b49b637a80c3c43a7a9455175577605b36820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Mon, 24 Jun 2024 13:38:17 +0200 Subject: [PATCH 31/45] Debug a little --- .github/workflows/build-plugin-archive.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index b26ae667..d3efd722 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -257,12 +257,15 @@ jobs: id: plugin-data run: echo "archive-name=${ARCHIVE_NAME:-${{ github.event.repository.name }}}" >> $GITHUB_OUTPUT + - name: List workspace + run: ls -als + - name: Add commit hash to plugin header - working-directory: ${{ needs.run-build-tools.outputs.artifact }} + #working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: 'sed -Ei "s/SHA: .*/SHA: ${GIT_SHA}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' - name: Set plugin version header - working-directory: ${{ needs.run-build-tools.outputs.artifact }} + #working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: 'sed -Ei "s/Version: .*/Version: ${PLUGIN_VERSION}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' - name: Set up PHP @@ -275,7 +278,7 @@ jobs: run: wp package install wp-cli/dist-archive-command - name: Execute custom code before archive creation - working-directory: ${{ needs.run-build-tools.outputs.artifact }} + #working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: | ${{ inputs.PRE_SCRIPT }} From 717326e2817c735ffc97c4af6effcd068d52b95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Mon, 24 Jun 2024 13:42:43 +0200 Subject: [PATCH 32/45] Remove working_dir configs since actions/download-artifact@v4 apparently downloads to the root folder again now --- .github/workflows/build-plugin-archive.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index d3efd722..aabb9dd8 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -257,15 +257,10 @@ jobs: id: plugin-data run: echo "archive-name=${ARCHIVE_NAME:-${{ github.event.repository.name }}}" >> $GITHUB_OUTPUT - - name: List workspace - run: ls -als - - name: Add commit hash to plugin header - #working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: 'sed -Ei "s/SHA: .*/SHA: ${GIT_SHA}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' - name: Set plugin version header - #working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: 'sed -Ei "s/Version: .*/Version: ${PLUGIN_VERSION}/g" ${{ inputs.PLUGIN_MAIN_FILE }}' - name: Set up PHP @@ -278,13 +273,12 @@ jobs: run: wp package install wp-cli/dist-archive-command - name: Execute custom code before archive creation - #working-directory: ${{ needs.run-build-tools.outputs.artifact }} run: | ${{ inputs.PRE_SCRIPT }} - name: Run WP-CLI command run: | - wp dist-archive ./${{ needs.run-build-tools.outputs.artifact }} ./archive.zip --plugin-dirname=${{ steps.plugin-folder-name.outputs.plugin-folder-name }} + wp dist-archive . ./archive.zip --plugin-dirname=${{ steps.plugin-folder-name.outputs.plugin-folder-name }} # GitHub Action artifacts would otherwise produce a zip within a zip - name: Unzip archive to dist/ From 67b8ac0016e08e9831f1e041a7918de90db5b5aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Mon, 24 Jun 2024 13:57:26 +0200 Subject: [PATCH 33/45] Fix job output --- .github/workflows/build-plugin-archive.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index aabb9dd8..819451b3 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -87,6 +87,8 @@ jobs: name: Install production dependencies timeout-minutes: 5 runs-on: ubuntu-latest + outputs: + artifact: ${{ steps.set-artifact-name.outputs.artifact }} env: ENV_VARS: ${{ secrets.ENV_VARS }} COMPOSER_AUTH: '${{ secrets.COMPOSER_AUTH_JSON }}' @@ -226,6 +228,7 @@ jobs: - name: Set artifact name id: set-artifact-name run: echo "artifact=interim-built" >> $GITHUB_OUTPUT + - name: Upload artifact uses: actions/upload-artifact@v4 with: From 9ee5dc5297bb44869ff0c8f9e47866381f1d3205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 3 Jul 2024 10:59:45 +0200 Subject: [PATCH 34/45] Declare job output of final archive creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 819451b3..5496da31 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -246,11 +246,13 @@ jobs: PLUGIN_FOLDER_NAME: ${{ inputs.PLUGIN_FOLDER_NAME }} GIT_SHA: ${{ github.sha }} PLUGIN_VERSION: ${{ inputs.PLUGIN_VERSION }} + outputs: + artifact: ${{ steps.set-artifact-name.outputs.artifact }} steps: - name: Download Artifact uses: actions/download-artifact@v4 with: - name: ${{ needs.run-build-tools.outputs.artifact }} + name: ${{ needs.create-plugin-archive.outputs.artifact }} - name: Set up plugin folder name id: plugin-folder-name From 1791b795868f5253f514afa4988efeb55b00b615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 3 Jul 2024 13:27:10 +0200 Subject: [PATCH 35/45] Fix variable name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 5496da31..92307cdc 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -252,7 +252,7 @@ jobs: - name: Download Artifact uses: actions/download-artifact@v4 with: - name: ${{ needs.create-plugin-archive.outputs.artifact }} + name: ${{ needs.run-build-tools.outputs.artifact }} - name: Set up plugin folder name id: plugin-folder-name From 29751851e5dea89fee3991da82ad5bf162b10164 Mon Sep 17 00:00:00 2001 From: Alex Pantechovskis Date: Tue, 3 Sep 2024 14:57:05 +0300 Subject: [PATCH 36/45] Add Rector in archive creation (#135) Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> --- .github/workflows/build-plugin-archive.yml | 24 +++++++++++++++++----- docs/archive-creation.md | 10 +++++---- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 92307cdc..72f4f3ef 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -135,7 +135,7 @@ jobs: !./.github run-build-tools: name: Process build steps - timeout-minutes: 5 + timeout-minutes: 10 runs-on: ubuntu-latest needs: checkout-dependencies env: @@ -153,7 +153,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ inputs.PHP_VERSION_BUILD }} - tools: humbug/php-scoper:dev-main + tools: humbug/php-scoper:dev-main, rector - name: Check optional Composer build tools id: composer-tools run: | @@ -164,12 +164,12 @@ jobs: echo "$EXIT" exit 0 fi - jq '.extra | has("composer-asset-compiler")' < composer.json >/dev/null 2>&1 + jq '.extra | has("composer-asset-compiler")' --exit-status < composer.json >/dev/null 2>&1 local EXIT=$? echo "$EXIT" } hasTranslateConfig(){ - jq '.extra | has("wp-translation-downloader")' < composer.json >/dev/null 2>&1 + jq '.extra | has("wp-translation-downloader")' --exit-status < composer.json >/dev/null 2>&1 local EXIT=$? echo "$EXIT" } @@ -178,9 +178,15 @@ jobs: local EXIT=$? echo "$EXIT" } + hasRectorConfig(){ + test -f rector.php + local EXIT=$? + echo "$EXIT" + } echo "assets-compiler=$( hasAssetConfig )" >> $GITHUB_OUTPUT echo "translation-downloader=$( hasTranslateConfig )" >> $GITHUB_OUTPUT echo "php-scoper=$( hasScoperConfig )" >> $GITHUB_OUTPUT + echo "rector=$( hasRectorConfig )" >> $GITHUB_OUTPUT - name: Set up node cache mode run: | @@ -215,6 +221,11 @@ jobs: composer global require inpsyde/wp-translation-downloader composer wp-translation-downloader:download + - name: Run Rector + if: steps.composer-tools.outputs.rector == '0' + run: | + rector + - name: Run PHP Scoper if: steps.composer-tools.outputs.php-scoper == '0' run: | @@ -223,7 +234,10 @@ jobs: sed -i "s/'__composer_autoload_files'/\'__composer_autoload_files_${{ github.sha }}'/g" "build/vendor/composer/autoload_real.php" - name: Move unchanged code to build directory if: steps.composer-tools.outputs.php-scoper != '0' - run: mv * build 2>/dev/null + run: | + shopt -s extglob dotglob + mkdir build + mv !(build) build - name: Set artifact name id: set-artifact-name diff --git a/docs/archive-creation.md b/docs/archive-creation.md index 2658c2e3..7a30ca3c 100644 --- a/docs/archive-creation.md +++ b/docs/archive-creation.md @@ -7,10 +7,12 @@ To achieve that, the reusable workflow: 1. Installs dependencies (including dev-dependencies) defined in `composer.json` 2. Executes `inpsyde/composer-assets-compiler` if required & configured by the package 3. Executes `inpsyde/wp-translation-downloader` if required & configured by the package -4. Re-installs dependencies without dev-dependencies -5. Sets current commit hash and plugin version in the plugin's main file -6. Runs `wp dist-archive` to create the final archive (with builtin support for a `.distignore` file) -7. Uploads it as an artifact for download or further processing +4. Executes PHP-Scoper if configured by the package +5. Executes Rector if configured by the package +6. Re-installs dependencies without dev-dependencies +7. Sets current commit hash and plugin version in the plugin's main file +8. Runs `wp dist-archive` to create the final archive (with builtin support for a `.distignore` file) +9. Uploads it as an artifact for download or further processing ## Simple usage example: From 5c9ca821c755b25a72c17f1dedb743f814387100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 3 Sep 2024 14:10:53 +0200 Subject: [PATCH 37/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 72f4f3ef..1559fa6a 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -149,7 +149,8 @@ jobs: uses: actions/download-artifact@v4 with: name: ${{ needs.checkout-dependencies.outputs.artifact }} - - name: Setup PHP with tools + + - name: Set up PHP uses: shivammathur/setup-php@v2 with: php-version: ${{ inputs.PHP_VERSION_BUILD }} From 47b51bc31784aac72a16d8b9b92160aee26b3cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 3 Sep 2024 14:11:07 +0200 Subject: [PATCH 38/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 1559fa6a..714365ec 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -227,7 +227,7 @@ jobs: run: | rector - - name: Run PHP Scoper + - name: Run PHP-Scoper if: steps.composer-tools.outputs.php-scoper == '0' run: | php-scoper add-prefix --force --output-dir build From 240dbc2433c2dfc1aaaa1c9e8ed612578976c19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Tue, 3 Sep 2024 14:18:13 +0200 Subject: [PATCH 39/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 714365ec..d5f370fd 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -154,7 +154,8 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ inputs.PHP_VERSION_BUILD }} - tools: humbug/php-scoper:dev-main, rector + tools: humbug/php-scoper, rector + - name: Check optional Composer build tools id: composer-tools run: | From bbddb409da211e6d77f2a28a4dbce8c7cee11d15 Mon Sep 17 00:00:00 2001 From: Alex Pantechovskis Date: Tue, 3 Sep 2024 17:29:02 +0300 Subject: [PATCH 40/45] Include hidden files in upload breaking change in actions/upload-artifact Signed-off-by: Alex Pantechovskis --- .github/workflows/build-plugin-archive.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index d5f370fd..d78964d4 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -133,6 +133,7 @@ jobs: !./.git !./.ddev !./.github + include-hidden-files: true run-build-tools: name: Process build steps timeout-minutes: 10 @@ -252,6 +253,7 @@ jobs: path: | build/ !build/**/node_modules + include-hidden-files: true create-plugin-archive: name: Create build archive timeout-minutes: 5 @@ -314,3 +316,4 @@ jobs: with: name: ${{ steps.set-artifact-name.outputs.artifact }} path: ./dist/* + include-hidden-files: true From f3ba405037a893406974e08d1919a530de593c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 4 Sep 2024 13:13:22 +0200 Subject: [PATCH 41/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index d78964d4..b38abb72 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -235,7 +235,8 @@ jobs: php-scoper add-prefix --force --output-dir build composer --working-dir=build dump-autoload -o sed -i "s/'__composer_autoload_files'/\'__composer_autoload_files_${{ github.sha }}'/g" "build/vendor/composer/autoload_real.php" - - name: Move unchanged code to build directory + - name: Move code to the `build/` directory + if: steps.composer-tools.outputs.php-scoper != '0' run: | shopt -s extglob dotglob From a9a9db53698e07b71b7e143e0be88f49c2644f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 4 Sep 2024 13:23:27 +0200 Subject: [PATCH 42/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index b38abb72..65895882 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -232,7 +232,7 @@ jobs: - name: Run PHP-Scoper if: steps.composer-tools.outputs.php-scoper == '0' run: | - php-scoper add-prefix --force --output-dir build + php-scoper add-prefix --force --output-dir=build composer --working-dir=build dump-autoload -o sed -i "s/'__composer_autoload_files'/\'__composer_autoload_files_${{ github.sha }}'/g" "build/vendor/composer/autoload_real.php" - name: Move code to the `build/` directory From adb611a7c76efb362434454d87809831b8eb289b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 4 Sep 2024 14:54:32 +0200 Subject: [PATCH 43/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 65895882..fbdeacbd 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -235,8 +235,8 @@ jobs: php-scoper add-prefix --force --output-dir=build composer --working-dir=build dump-autoload -o sed -i "s/'__composer_autoload_files'/\'__composer_autoload_files_${{ github.sha }}'/g" "build/vendor/composer/autoload_real.php" - - name: Move code to the `build/` directory + - name: Move code to the `build/` directory if: steps.composer-tools.outputs.php-scoper != '0' run: | shopt -s extglob dotglob From 3765dc4266a38b3ec29848e1ed42db2d3bd6e372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 4 Sep 2024 14:54:47 +0200 Subject: [PATCH 44/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index fbdeacbd..4d0816d6 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -134,6 +134,7 @@ jobs: !./.ddev !./.github include-hidden-files: true + run-build-tools: name: Process build steps timeout-minutes: 10 From 095ab16b5412e81a5306548b613d7e5b43459f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20Mei=C3=9Felbach?= Date: Wed, 4 Sep 2024 14:55:07 +0200 Subject: [PATCH 45/45] Update .github/workflows/build-plugin-archive.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com> Signed-off-by: Moritz Meißelbach --- .github/workflows/build-plugin-archive.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-plugin-archive.yml b/.github/workflows/build-plugin-archive.yml index 4d0816d6..d72807ce 100644 --- a/.github/workflows/build-plugin-archive.yml +++ b/.github/workflows/build-plugin-archive.yml @@ -256,6 +256,7 @@ jobs: build/ !build/**/node_modules include-hidden-files: true + create-plugin-archive: name: Create build archive timeout-minutes: 5