Build/Test Tools: Don’t ZIP theme ZIP files.

When uploading artifacts during GitHub Action workflows, all files uploaded to an artifact name are zipped. When a ZIP file is uploaded, the result is a horrifying state of ZIP-ception.

This changes the workflow to upload all of the needed theme files to the artifact instead of a singular ZIP file created prior to uploading.

This also fixes a bug where ZIP files generated have the desired theme nested within `src/wp-content/themes` instead of just containing the theme files.

Props ndiego, wildworks, desrosj, bgardner, colorful-tones.
Fixes #56898.

git-svn-id: https://develop.svn.wordpress.org/trunk@54740 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2022-11-01 19:18:50 +00:00
parent 4e5e054771
commit 6226440bda

View File

@ -97,8 +97,7 @@ jobs:
#
# Performs the following steps:
# - Checks out the repository.
# - Creates a ZIP file of the theme for wordpress.org.
# - Uploads the ZIP file as a workflow artifact.
# - Uploads the theme files as a workflow artifact (files uploaded as an artifact are automatically zipped).
bundle-theme:
name: Create ${{ matrix.theme }} ZIP file
runs-on: ubuntu-latest
@ -130,14 +129,12 @@ jobs:
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }}
- name: Create theme ZIP file
run: zip -r ${{ matrix.theme }}.zip src/wp-content/themes/${{ matrix.theme }} -x "*/node_modules/*"
- name: Upload theme ZIP as an artifact
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
with:
if-no-files-found: error
name: ${{ matrix.theme }}
path: ${{ matrix.theme }}.zip
path: src/wp-content/themes/${{ matrix.theme }}
slack-notifications:
name: Slack Notifications