-
Notifications
You must be signed in to change notification settings - Fork 132
311 lines (281 loc) · 9.99 KB
/
static-release-push.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
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
name: Static Post-Release Build
# on: [push]
#
# on:
# release:
# types: [published]
on: [workflow_dispatch]
# TODO:
# - Can we check out first, bootstrap and then cache/upload/download into container?
# - Build for sunOS?
# - Cache / Speedup VM builds (OpenBSD, FreeBSD, macOS)
permissions:
contents: write
env:
OPENSSL_VER: 1.1.1w
VER: 1.4.44dev1
jobs:
# Create release Tarballs
Source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: dist
run: |
./bootstrap
./configure
make dist
- name: Upload dist
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gsocket-*.tar.gz
# overwrite: true
file_glob: true
tag: v${{ env.VER }}
MacOS:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- name: Compile
run: |
brew install automake
./bootstrap
./configure --prefix=/opt --enable-static
make all
strip tools/gs-netcat
(cd tools; tar cfz ../gsocket_macOS.tar.gz gs-netcat gsocket blitz gs-mount gs-sftp gs_funcs gsocket_dso.so.0 gsocket_uchroot_dso.so.0)
mv tools/gs-netcat gs-netcat_macOS
- name: Upload gs-netcat to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gs-netcat_*
overwrite: true
file_glob: true
tag: v${{ env.VER }}
- name: Upload gsocket to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gsocket_*
overwrite: true
file_glob: true
tag: v${{ env.VER }}
FreeBSD:
env:
OS: "freebsd"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Starting the VM
uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
pkg install -y curl automake autoconf gcc
run: |
curl -SsfL https://www.openssl.org/source/openssl-${OPENSSL_VER:-1.1.1w}.tar.gz | tar -xzf - -C /tmp/
( cd /tmp/openssl-${OPENSSL_VER:-1.1.1w} && \
./Configure --prefix=/opt no-tests no-dso no-threads no-shared BSD-generic64 && \
make install_sw )
rm -rf rm -rf /tmp/openssl-${OPENSSL_VER:-1.1.1w} /opt/bin/openssl /opt/bin/c_rehash
./bootstrap
./configure --enable-static --prefix=/opt
make all
strip tools/gs-netcat
(cd tools; tar cfz ../gsocket_${{ env.OS }}-x86_x64.tar.gz gs-netcat gsocket blitz gs-mount gs-sftp gs_funcs gsocket_dso.so.0 gsocket_uchroot_dso.so.0)
mv tools/gs-netcat gs-netcat_${{ env.OS }}-x86_64
- name: Upload gs-netcat to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gs-netcat_*
overwrite: true
file_glob: true
tag: v${{ env.VER }}
- name: Upload gsocket to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gsocket_*
overwrite: true
file_glob: true
tag: v${{ env.VER }}
# https://github.com/vmactions/openbsd-vm
OpenBSD:
env:
OS: "openbsd"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Starting the VM
uses: vmactions/openbsd-vm@v1
with:
usesh: true
prepare: |
pkg_add curl
pkg_add autoconf-2.71
pkg_add automake-1.16.5
pkg_add openssl-3.0.8
pkg_info -Q tar
pkg_add gcc-11.2.0p3
pkg_add gmake
pkg_add tar
run: |
curl -SsfL https://www.openssl.org/source/openssl-${OPENSSL_VER:-1.1.1w}.tar.gz | tar -xzf - -C /tmp/
( cd /tmp/openssl-${OPENSSL_VER:-1.1.1w} && \
./Configure --prefix=/opt no-tests no-dso no-threads no-shared BSD-generic64 && \
make install_sw )
rm -rf rm -rf /tmp/openssl-${OPENSSL_VER:-1.1.1w} /opt/bin/openssl /opt/bin/c_rehash
export AUTOCONF_VERSION=2.71
export AUTOMAKE_VERSION=1.16
./bootstrap
./configure --enable-static --prefix=/opt
make all
strip tools/gs-netcat
(cd tools; tar cfz ../gsocket_${{ env.OS }}-x86_x64.tar.gz gs-netcat gsocket blitz gs-mount gs-sftp gs_funcs gsocket_dso.so.0 gsocket_uchroot_dso.so.0)
mv tools/gs-netcat gs-netcat_${{ env.OS }}-x86_64
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Compile
# uses: vmactions/openbsd-vm@v1
# with:
# usesh: true
# prepare: |
# pkg_add curl
# pkg_add autoconf-2.71
# pkg_add automake-1.16.5
# pkg_add openssl-3.0.8
# pkg_info -Q tar
# pkg_add gcc-11.2.0p3
# pkg_add gmake
# pkg_add tar
# run: |
# export AUTOCONF_VERSION=2.71
# export AUTOMAKE_VERSION=1.16
# ./bootstrap
# export CPPFLAGS="-I/usr/local/include/eopenssl30/"
# export LDFLAGS="-L/usr/local/lib/eopenssl30/"
# ./configure --enable-static
# make all
# strip tools/gs-netcat
# (cd tools; tar cfz ../gsocket_openbsd-x86_x64.tar.gz gs-netcat gsocket blitz gs-mount gs-sftp gs_funcs gsocket_dso.so.0 gsocket_uchroot_dso.so.0)
# mv tools/gs-netcat gs-netcat_openbsd-x86_64
- name: Upload gs-netcat to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gs-netcat_*
overwrite: true
file_glob: true
tag: v${{ env.VER }}
- name: Upload gsocket to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gsocket_*
overwrite: true
file_glob: true
tag: v${{ env.VER }}
Linux-Cross-Compile:
strategy:
matrix:
arch: [x86_64, aarch64, mips64, mips32, mipsel, i686, arm, armv6, armv7l]
include:
- arch: x86_64
cc: x86_64-linux-musl
ssl: linux-generic64
- arch: aarch64
cc: aarch64-linux-musl
ssl: linux-generic64
- arch: mips64
cc: mips64-linux-musl
ssl: linux64-mips64
- arch: mips32
cc: mips-linux-muslsf
ssl: linux-mips32
- arch: mipsel
cc: mipsel-linux-muslsf
ssl: linux-mips32
- arch: i686
cc: i686-linux-musl
ssl: linux-generic32
- arch: arm
cc: arm-linux-musleabi
ssl: linux-generic32
- arch: armv6
cc: armv6-linux-musleabi
ssl: linux-generic32
- arch: armv7l
cc: armv7l-linux-musleabihf
ssl: linux-generic32
runs-on: ubuntu-latest
container:
image: muslcc/x86_64:${{ matrix.cc }}
options: --user root
steps:
- uses: actions/checkout@v3
- name: Add build dependencies
run: |
apk add --update --no-cache --no-progress bash perl make curl upx tar dpkg
- name: Cache SSL
id: cachessl
uses: actions/cache@v3
with:
path: /opt
key: ${{ matrix.arch }}-ssl
- name: Generate OpenSSL
if: steps.cachessl.outputs.cache-hit != 'true'
run: |
curl -SsfL https://www.openssl.org/source/openssl-${OPENSSL_VER:-1.1.1k}.tar.gz | tar -xzf - -C /tmp/
( cd /tmp/openssl-${OPENSSL_VER:-1.1.1k} && \
./Configure --prefix=/opt no-tests no-dso no-threads no-shared ${{ matrix.ssl }} && \
make install_sw )
rm -rf rm -rf /tmp/openssl-${OPENSSL_VER:-1.1.1k} /opt/bin/openssl /opt/bin/c_rehash
- name: SaveCache
if: steps.cachessl.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: /opt
key: ${{ matrix.arch }}-ssl
- name: Compile-${{ matrix.arch }}
run: |
apk add --no-cache autoconf automake
./bootstrap
./configure --prefix=/opt --enable-realprefix=/usr --enable-static --host=${{ matrix.arch }}
make all
strip tools/gs-netcat
(cd tools; tar cfz ../gsocket_linux-${{ matrix.arch }}.tar.gz gs-netcat gsocket blitz gs-mount gs-sftp gs_funcs gsocket_dso.so.0 gsocket_uchroot_dso.so.0)
mv tools/gs-netcat gs-netcat_linux-${{ matrix.arch }}
- name: Debian packages
run: |
PREFIX="/tmp/gsocket_${{ env.VER }}_${{ matrix.arch }}"
make DESTDIR="${PREFIX}" install
mkdir -p "${PREFIX}/DEBIAN"
sed "s/@@VER@@/${VER}/" <"packaging/debian-deb/DEBIAN/control.in" >"${PREFIX}/DEBIAN/control"
mv "${PREFIX}/opt" "${PREFIX}/usr"
mv "${PREFIX}/usr/etc" "${PREFIX}/etc"
dpkg-deb --build "${PREFIX}/"
- name: Upload .deb to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /tmp/gsocket_${{ env.VER }}_${{ matrix.arch }}.deb
overwrite: true
tag: v${{ env.VER }}
- name: Upload gs-netcat to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gs-netcat_linux-${{ matrix.arch }}
overwrite: true
tag: v${{ env.VER }}
- name: Upload gsocket to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: gsocket_linux-${{ matrix.arch }}.tar.gz
overwrite: true
tag: v${{ env.VER }}