Tweak GitHub Actions workflow so Ghidra recognizes artifact files as … #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ghidra: | |
- "11.0.1" | |
- "11.0" | |
- "10.4" | |
- "10.3.3" | |
- "10.3.2" | |
- "10.3.1" | |
- "10.3" | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
- name: Install Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/[email protected] | |
- name: Install Ghidra ${{ matrix.ghidra }} | |
uses: antoniovazquezblanco/[email protected] | |
with: | |
auth_token: ${{ secrets.GITHUB_TOKEN }} | |
version: ${{ matrix.ghidra }} | |
- name: Build the extension for Ghidra ${{ matrix.ghidra }} | |
run: gradle -PGHIDRA_INSTALL_DIR=${GHIDRA_INSTALL_DIR} -p GhidraNes | |
- name: Prepare artifact | |
id: prepare | |
run: | | |
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: GhidraNes_Ghidra_${{ matrix.ghidra }} | |
path: ${{ steps.prepare.outputs.artifact-path }} |