-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (87 loc) · 2.55 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Build
on:
push:
pull_request:
workflow_dispatch:
inputs:
tag:
type: string
required: true
annotation:
type: string
required: false
permissions:
contents: write
discussions: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ghidra:
# Add a fallback version to the matrix so the latest (at the time CI runs) is always used first
- "latest"
- "11.1.2"
- "11.1.1"
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Install Gradle
uses: gradle/actions/setup-gradle@v4
- name: Install Ghidra ${{ matrix.ghidra }}
uses: antoniovazquezblanco/setup-ghidra@v2.0.5
with:
auth_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ matrix.ghidra }}
sha256sum: 'online'
owner: 'NationalSecurityAgency'
- name: List files
run: ls -lhR
- name: Build
run: gradle --console plain buildExtension
working-directory: ./ghidra_yara
env:
GITHUB_TOKEN: ${{ secrets.READONLY_PUBLIC_REPO_PAT }}
GITHUB_USERNAME: ${{ secrets.READONLY_PUBLIC_REPO_USER }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: GhidraYara_Ghidra_${{ matrix.ghidra }}
path: ghidra_yara/dist/*.zip
release:
runs-on: "ubuntu-latest"
needs: build
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Download binaries
uses: actions/download-artifact@v4
- name: List files
run: ls -lhR
- name: Release nightly
if: github.ref == 'refs/heads/main'
uses: plu5/automatic-releases-with-sha-action@main
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
draft: false
is_tag_static: true
title: "GhidraYara Nightly (${{steps.date.outputs.date}})"
files: GhidraYara_Ghidra_*/*.zip
tag_annotation: ${{ inputs.annotation }}
- name: Release stable
if: contains(github.ref, 'refs/tags/v')
uses: plu5/automatic-releases-with-sha-action@main
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
title: "GhidraYara ${{github.ref_name}}"
files: GhidraYara_Ghidra_*/*.zip
tag_annotation: ${{ inputs.annotation }}