forked from NationalSecurityAgency/ghidra
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (115 loc) · 4.05 KB
/
release.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Release Ghidra
on:
pull_request:
push:
branches:
- batteries-included
jobs:
build-natives:
name: Build Native Binaries
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- { task: mac_x86_64, os: macos-latest, dist: natives-macos }
- { task: win_x86_64, os: windows-latest, dist: natives-windows }
- { task: linux_x86_64, os: ubuntu-latest, dist: natives-linux }
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Install bison
if: ${{ matrix.os == 'windows-latest' }}
run: |
choco install winflexbison
ren "C:\ProgramData\chocolatey\bin\win_bison.exe" "bison.exe"
ren "C:\ProgramData\chocolatey\bin\win_flex.exe" "flex.exe"
- uses: eskatos/gradle-command-action@v1
with:
gradle-version: current
arguments: --init-script gradle/support/fetchDependencies.gradle init
- uses: eskatos/gradle-command-action@v1
with:
gradle-version: 6.8.3
arguments: buildNatives_${{ matrix.task }}
- name: Upload Native Binary
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.dist }}
path: "**/build/os/${{ matrix.task }}/"
dist-ghidra:
name: Build and Release Ghidra
needs: [ build-natives ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Download windows binaries
uses: actions/download-artifact@v2
with:
name: natives-windows
- name: Download MacOS binaries
uses: actions/download-artifact@v2
with:
name: natives-macos
- name: Download Linux binaries
uses: actions/download-artifact@v2
with:
name: natives-linux
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Apply submodule patches
run: ./patches/x.sh apply
- uses: eskatos/gradle-command-action@v1
with:
gradle-version: current
arguments: --init-script gradle/support/fetchDependencies.gradle init
- name: Download ghidra-data
uses: actions/checkout@v2
with:
repository: NationalSecurityAgency/ghidra-data
path: ghidra-data
- name: Copy ghidra-data files into the appropriate directories
run: cp -r ghidra-data/FunctionID/* Ghidra/Features/FunctionID/data
- name: Build ghidra, create a cross-platform distribution
uses: eskatos/gradle-command-action@v1
with:
gradle-version: current
arguments: -x ip -PallPlatforms buildGhidra
- name: Upload Ghidra Zip
uses: actions/upload-artifact@v2
with:
name: ghidra
path: "build/dist/*"
- name: Get current date, rev and dist name
id: date
if: github.ref == 'refs/heads/batteries-included'
run: |
echo ::set-output name=date::$(date +'%Y-%m-%d')
echo ::set-output name=dist::$(ls build/dist)
echo ::set-output name=rev::$(git rev-parse --short HEAD)
- name: Create Release
id: create_release
if: github.ref == 'refs/heads/batteries-included'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.date.outputs.date }}
release_name: Release ${{ steps.date.outputs.date }}(${{ steps.date.outputs.rev }})
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
if: github.ref == 'refs/heads/batteries-included'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/dist/${{ steps.date.outputs.dist }}
asset_name: release.zip
asset_content_type: application/zip