From 52b20db72f2ae19a2c7dff91129fc19e2c12098f Mon Sep 17 00:00:00 2001 From: Kyle Lacy Date: Sun, 10 Mar 2024 18:53:08 -0700 Subject: [PATCH] Tweak GitHub Actions workflow so Ghidra recognizes artifact files as plugins This undoes aaaca7bb6127c5e010251825e0928e713dcb8cd8, as I couldn't get GitHub Actions to create a ZIP file that Ghidra recognized --- .github/workflows/build.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 350eebb..8bef3d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,17 +36,23 @@ jobs: version: ${{ matrix.ghidra }} - name: Build the extension for Ghidra ${{ matrix.ghidra }} - run: gradle -PGHIDRA_INSTALL_DIR=${{ env.GHIDRA_INSTALL_DIR }} -p GhidraNes + run: gradle -PGHIDRA_INSTALL_DIR=${GHIDRA_INSTALL_DIR} -p GhidraNes - name: Prepare artifact id: prepare run: | - (cd GhidraNes/dist && unzip *.zip) - echo "short_sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT" - echo "date=$(date -u +'%Y%m%d')" >> "$GITHUB_OUTPUT" + original_filename="$(cd GhidraNes/dist && ls *.zip | head -n1)" + artifact_name="ghidra_${GHIDRA_VERSION}_$(git rev-parse --short HEAD)_$(date -u +'%Y%m%d')_GhidraNes" + + echo "Renaming $original_filename to ${artifact_name}.zip" + mv "GhidraNes/dist/$original_filename" "GhidraNes/dist/${artifact_name}.zip" + + echo "artifact-path=GhidraNes/dist/${artifact_name}.zip" >> "$GITHUB_OUTPUT" + env: + GHIDRA_VERSION: ${{ matrix.ghidra }} - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: ghidra_${{ matrix.ghidra }}_${{ steps.prepare.outputs.short_sha }}_${{ steps.prepare.outputs.date }}_GhidraNes - path: GhidraNes/dist/GhidraNes + name: GhidraNes_Ghidra_${{ matrix.ghidra }} + path: ${{ steps.prepare.outputs.artifact-path }}