Use absolute path to Ghidra dist #10
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: | |
branches: | |
- "main" | |
- "release/*" | |
pull_request: | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
# Prepare environment and build the plugin | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
# Validate wrapper | |
- name: Gradle Wrapper Validation | |
uses: gradle/wrapper-validation-action@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: 17 | |
# Setup Gradle | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
gradle-home-cache-cleanup: true | |
build-scan-publish: true | |
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
build-scan-terms-of-use-agree: "yes" | |
- name: Export Ghidra Properties | |
id: ghidra-properties | |
run: | | |
GHIDRA_REF=$(git rev-parse HEAD) | |
echo "ghidra-ref=$GHIDRA_REF" >> $GITHUB_OUTPUT | |
working-directory: ghidra | |
- name: Restore Ghidra Distribution cache | |
id: cache-ghidra | |
uses: actions/cache/restore@v4 | |
with: | |
path: ghidra/build | |
key: "${{ runner.os }}-ghidra-${{ steps.ghidra-properties.outputs.ghidra-ref }}" | |
- name: Build Ghidra Distribution | |
if: steps.cache-ghidra.outputs.cache-hit != 'true' | |
run: | | |
gradle -I gradle/support/fetchDependencies.gradle init | |
gradle assembleAll -x sleighCompile -x ip | |
working-directory: ghidra | |
- name: Save Ghidra Distribution cache | |
uses: actions/cache/save@v4 | |
with: | |
path: ghidra/build | |
key: ${{ steps.cache-ghidra.outputs.cache-primary-key }} | |
# Build plugin | |
- name: Build plugin | |
env: | |
GHIDRA_DIR: ghidra/build/dist/ghidra_11.0.3_DEV | |
run: ./gradlew assembleDist -Dorg.gradle.project.ghidra.dir=`pwd`/ghidra/build/dist/ghidra_11.0.3_DEV | |
- name: Qodana - Code Inspection | |
uses: JetBrains/[email protected] | |
with: | |
cache-default-branch-only: true | |
# # Store already-built plugin as an artifact for downloading | |
# - name: Upload artifact | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: ${{ steps.artifact.outputs.filename }} | |
# path: ./build/distributions/content/*/* | |
# Run tests and upload a code coverage report | |
# test: | |
# name: Test | |
# needs: [ build ] | |
# runs-on: ubuntu-latest | |
# steps: | |
# | |
# # Check out current repository | |
# - name: Fetch Sources | |
# uses: actions/checkout@v4 | |
# | |
# # Setup Gradle | |
# - name: Setup Gradle | |
# uses: gradle/actions/setup-gradle@v3 | |
# with: | |
# gradle-home-cache-cleanup: true | |
# | |
# # Run tests | |
# - name: Run Tests | |
# run: ./gradlew check | |
# | |
# # Collect Tests Result of failed tests | |
# - name: Collect Tests Result | |
# if: ${{ failure() }} | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: tests-result | |
# path: ${{ github.workspace }}/build/reports/tests | |
# | |
# # Upload the Kover report to CodeCov | |
# - name: Upload Code Coverage Report | |
# uses: codecov/codecov-action@v4 | |
# with: | |
# files: ${{ github.workspace }}/build/reports/kover/report.xml | |
release: | |
name: Release draft | |
if: github.event_name != 'pull_request' | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- uses: google-github-actions/release-please-action@v4 | |
with: | |
config-file: .github/release-please-config.json |