From 6b88431abe145772b2bbc5cd8f75af75a45f4420 Mon Sep 17 00:00:00 2001 From: Leopold Date: Sun, 23 Jan 2022 22:25:19 +0800 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 66 +++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..558c58d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,66 @@ +name: Ghidra CSKY Extension Build + +env: + ghidra-url: https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.1.1_build/ghidra_10.1.1_PUBLIC_20211221.zip + ghidra-zip-filename: ghidra_10.1.1_PUBLIC_20211221.zip + ghidra-directory: ghidra_10.1.1_PUBLIC + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + release: + types: [ created ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Download Ghidra release + uses: carlosperate/download-file-action@v1.0.3 + id: download-ghidra + with: + file-url: ${{ env.ghidra-url }} + file-name: ${{ env.ghidra-zip-filename }} + + - name: Unzip Ghidra + uses: TonyBogdanov/zip@1.0 + with: + args: unzip -qq ${{ steps.download-ghidra.outputs.file-path }} -d . + - uses: actions/setup-java@v1 + with: + java-version: '11.0.2' + + - name: Build extension + uses: eskatos/gradle-command-action@v1 + with: + gradle-version: '7.3' + build-root-directory: ${{ github.workspace }}/CSKY + arguments: '-PGHIDRA_INSTALL_DIR=${{ github.workspace }}/${{ env.ghidra-directory }}' + + - name: Upload built extension + uses: actions/upload-artifact@v2 + with: + name: extension + path: CSKY/dist/*.zip + + release: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'release' }} + needs: build + + steps: + - name: Download built extension + uses: actions/download-artifact@v2 + with: + name: extension + - name: Upload extension to release + uses: skx/github-action-publish-binaries@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: '*.zip'