Skip to content

Commit

Permalink
CI revamp by antoniovazquezblanco (#3)
Browse files Browse the repository at this point in the history
This commit adds improvements to the CI workflows for the extension.
  • Loading branch information
antoniovazquezblanco authored Feb 7, 2024
1 parent ef358d6 commit bdb51d6
Showing 1 changed file with 19 additions and 28 deletions.
47 changes: 19 additions & 28 deletions .github/workflows/build_extension.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Build extension

on:
workflow_dispatch:
on: [push, pull_request, workflow_dispatch]

jobs:
build:
Expand All @@ -13,39 +12,31 @@ jobs:

strategy:
matrix:
#108785380 is Ghidra 10.3.1, 111929518 is Ghidra 10.3.2, 123122126 is Ghidra 10.4
ghidra-release-id: [ "108785380", "111929518" , "123122126", "latest" ]

env:
GHIDRA_RELEASE_ID: ${{ matrix.ghidra-release-id }}
ghidra:
- "11.0"
- "10.4"
- "10.3.3"
- "10.3.2"
- "10.3.1"
- "10.3"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
java-version: '17'

#Yoinked from https://github.com/bkerler/ghidra_installer/blob/master/install-ghidra.sh
- name: Install Ghidra
run: |
export GHIDRALINK=`curl -s https://api.github.com/repos/NationalSecurityAgency/ghidra/releases/$GHIDRA_RELEASE_ID | grep "browser_download_url.*zip" | cut -d : -f 2,3 | tr -d \" | tr -d " "`
export GHIDRA=`echo $GHIDRALINK | sed 's/^.*\(ghidra.*\).*$/\1/' `
export GHIDRADIR=`echo $GHIDRA | sed 's/_20[12][0-9].*//' `
mkdir build
cd build
wget -c "$GHIDRALINK" || exit 1
unzip "$GHIDRA" > /dev/null || exit 1
echo GHIDRA_INSTALL_DIR=$PWD/$GHIDRADIR >> "$GITHUB_ENV"
uses: antoniovazquezblanco/[email protected]
with:
auth_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ matrix.ghidra }}

- name: Setup Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
uses: gradle/gradle-build-action@v2.11.1

- name: Update extension properties
run: |
Expand All @@ -56,11 +47,11 @@ jobs:
echo "version=@extversion@" >> extension.properties
- name: Build extension
run: gradle
run: gradle -PGHIDRA_INSTALL_DIR=${{ env.GHIDRA_INSTALL_DIR }}

- name: Upload Build Artifact
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4
with:
name: VitaLoader Redux
name: VitaLoader Redux for Ghidra ${{ matrix.ghidra }}
path: dist/ghidra_*_VitaLoaderRedux.zip
if-no-files-found: warn

0 comments on commit bdb51d6

Please sign in to comment.