forked from klei1984/le_disasm
-
Notifications
You must be signed in to change notification settings - Fork 0
235 lines (203 loc) · 6.05 KB
/
build.yaml
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
name: Build
on:
pull_request:
push:
branches:
- master
workflow_dispatch:
inputs:
refToBuild:
description: 'Branch, tag or commit SHA1 to build'
required: true
type: string
jobs:
ubuntu-gcc-x86_64:
runs-on: ubuntu-22.04
name: "Linux Ubuntu, arch x86_64"
container:
image: ubuntu:22.04
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
steps:
- name: Install GIT
run: |
# install GIT, as without it checkout would use REST API
apt update
apt install -y \
git
- name: Checkout code at latest head
if: "${{ inputs.refToBuild == '' }}"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout code at requested ref
if: "${{ inputs.refToBuild != '' }}"
uses: actions/checkout@v3
with:
ref: ${{ inputs.refToBuild }}
fetch-depth: 0
- name: Set ownership
run: |
# this is to fix GIT not liking owner of the checkout dir
chown -R $(id -u):$(id -g) $PWD
- name: Install dependencies
run: |
apt update
apt install -y \
libc6-dev gettext \
libiberty-dev \
binutils-dev \
libzstd-dev
apt install -y \
build-essential autoconf libtool make
- name: Autoreconf
run: autoreconf -ivf
- name: Configure
id: configure-app
run: |
mkdir -p release; cd release
../configure
- name: Upload Configure logs
if: failure() && steps.configure-app.outcome != 'success'
uses: actions/upload-artifact@v3
with:
name: configure-ubuntu-x86_64-logs
path: release/config.log
retention-days: 10
- name: Build executable
run: |
cd release
make V=1
- name: Copy for package
run: |
cd release
# Get version marking from C header
PKG_VERSION=$(sed -n 's/^#define[ ]\+PACKAGE_VERSION "\([^"]\+\)"$/\1/p' src/config.h | head -n 1 | tr '.' '_')
make V=1 DESTDIR=$PWD/pkg install
echo "PKG_NAME=le_disasm-$PKG_VERSION-ubuntu-x86_64" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: release/pkg/**
windows-msys2-x86:
name: "Windows MSYS2, arch x86"
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout code at latest head
if: "${{ inputs.refToBuild == '' }}"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout code at requested ref
if: "${{ inputs.refToBuild != '' }}"
uses: actions/checkout@v3
with:
ref: ${{ inputs.refToBuild }}
fetch-depth: 0
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: true
install: >-
git
unzip
mingw-w64-i686-toolchain
mingw-w64-i686-autotools
- name: Autoreconf
run: autoreconf -ivf
- name: Configure
id: configure-app
env:
CFLAGS: "-m32"
CXXFLAGS: "-m32"
LDFLAGS: "-m32"
run: |
mkdir -p release; cd release
../configure
- name: Upload Configure logs
if: failure() && steps.configure-app.outcome != 'success'
uses: actions/upload-artifact@v3
with:
name: configure-win-x86-logs
path: release/config.log
retention-days: 10
- name: Build executable
run: |
cd release
make V=1
- name: Copy for package
run: |
cd release
# Get version marking from C header
PKG_VERSION=$(sed -n 's/^#define[ ]\+PACKAGE_VERSION "\([^"]\+\)"$/\1/p' src/config.h | head -n 1 | tr '.' '_')
make V=1 DESTDIR=$PWD/pkg install
echo "PKG_NAME=le_disasm-$PKG_VERSION-win-x86" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: release/pkg/**
windows-msys2-x86_64:
name: "Windows MSYS2, arch x86_64"
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout code at latest head
if: "${{ inputs.refToBuild == '' }}"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout code at requested ref
if: "${{ inputs.refToBuild != '' }}"
uses: actions/checkout@v3
with:
ref: ${{ inputs.refToBuild }}
fetch-depth: 0
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
git
unzip
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-autotools
- name: Autoreconf
run: autoreconf -ivf
- name: Configure
id: configure-app
run: |
mkdir -p release; cd release
../configure
- name: Upload Configure logs
if: failure() && steps.configure-app.outcome != 'success'
uses: actions/upload-artifact@v3
with:
name: configure-win-x86_64-logs
path: release/config.log
retention-days: 10
- name: Build executable
run: |
cd release
make V=1
- name: Copy for package
run: |
cd release
# Get version marking from C header
PKG_VERSION=$(sed -n 's/^#define[ ]\+PACKAGE_VERSION "\([^"]\+\)"$/\1/p' src/config.h | head -n 1 | tr '.' '_')
make V=1 DESTDIR=$PWD/pkg install
echo "PKG_NAME=le_disasm-$PKG_VERSION-win-x86_64" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.PKG_NAME }}
path: release/pkg/**