Skip to content

Commit

Permalink
Fix: plugin archive correct job output (inpsyde#133)
Browse files Browse the repository at this point in the history
* Put job output config into correct job

* Update build-plugin-archive.yml to Include Interim Steps and Clean Up (inpsyde#129)

* Add debug step

* Debug before upload artifact

* Try changing directory

* Removing quotes to sed to evaluate variables

* Using the subfolder for the next steps too

* Trying to find the right folder, debug

* Trying to output the right artifact, debug

* Reference the step before, debug

* Debug the 2 folders

* Rollback to previous artifacts debug

* try setting another name debug

* try setting another name debug

* rollback to previous artifact name

* remove log

* use working-directory

* remove with dist file

---------

Co-authored-by: Carmen Maymó <[email protected]>
  • Loading branch information
Biont and mmaymo authored Jun 20, 2024
1 parent 5666680 commit bdc761e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build-plugin-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ jobs:
# During development, symlinking is preferable.
# In resulting builds, you will likely want to ship the actual install location and remove the source directory.
COMPOSER_MIRROR_PATH_REPOS: 1
outputs:
artifact: ${{ steps.set-artifact-name.outputs.artifact }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -224,6 +222,8 @@ 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
Expand All @@ -239,9 +239,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
run: 'sed -Ei "s/SHA: .*/SHA: ${GIT_SHA}/g" ${{ inputs.PLUGIN_MAIN_FILE }}'

- name: Set plugin version header
working-directory: interim-deps
run: 'sed -Ei "s/Version: .*/Version: ${PLUGIN_VERSION}/g" ${{ inputs.PLUGIN_MAIN_FILE }}'

- name: Set up PHP
Expand All @@ -258,7 +260,8 @@ jobs:
${{ inputs.PRE_SCRIPT }}
- name: Run WP-CLI command
run: wp dist-archive . ./archive.zip --plugin-dirname=${{ steps.plugin-folder-name.outputs.plugin-folder-name }}
run: |
wp dist-archive ./interim-deps ./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/
Expand Down

0 comments on commit bdc761e

Please sign in to comment.