Static Stealth Build & www push #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Static Stealth Build & www push | |
on: [workflow_dispatch] | |
permissions: | |
contents: write | |
env: | |
OPENSSL_VER: 1.1.1w | |
VER: 1.4.42dev2 | |
jobs: | |
MacOS: | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Compile | |
run: | | |
brew install automake | |
./bootstrap | |
./configure --prefix=/opt --enable-static --enable-stealth | |
make all | |
strip tools/gs-netcat | |
mv tools/gs-netcat tools/gs-netcat_mini-macOS-x86_64 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gsnc | |
path: tools/gs-netcat_mini-macOS-x86_64 | |
# 2024-01-09, throws errors: Job is about to start running on the hosted runner: GitHub Actions 5 (hosted) | |
# MacOS-arm64: | |
# runs-on: macos-latest-xlarge | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Compile | |
# run: | | |
# brew install automake | |
# ./bootstrap | |
# ./configure --prefix=/opt --enable-static --enable-stealth | |
# make all | |
# strip tools/gs-netcat | |
# mv tools/gs-netcat tools/gs-netcat_mini-macOS-arm64 | |
# - name: Upload artifacts | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: gsnc | |
# path: tools/gs-netcat_mini-macOS-arm64 | |
# # https://github.com/vmactions/openbsd-vm | |
OpenBSD: | |
env: | |
OS: "openbsd" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 --enable-stealth | |
make all | |
strip tools/gs-netcat | |
mv tools/gs-netcat tools/gs-netcat_mini-${{ env.OS }}-x86_64 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gsnc | |
path: tools/gs-netcat_mini-${{ env.OS }}-x86_64 | |
FreeBSD: | |
env: | |
OS: "freebsd" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 --enable-stealth | |
make all | |
strip tools/gs-netcat | |
mv tools/gs-netcat tools/gs-netcat_mini-${{ env.OS }}-x86_64 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gsnc | |
path: tools/gs-netcat_mini-${{ env.OS }}-x86_64 | |
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 | |
# upx: 1 some linux kernels kill UPX packed binaries..(grsec?) | |
- arch: aarch64 | |
cc: aarch64-linux-musl | |
ssl: linux-generic64 | |
# upx: 1 | |
- 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 autoconf automake | |
- 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: | | |
[ ! -d /opt/dist ] && mkdir -p /opt/dist | |
./bootstrap | |
./configure --prefix=/opt --enable-realprefix=/usr --enable-static --host=${{ matrix.arch }} --enable-stealth | |
make all | |
echo "UPX='${{ matrix.upx }}'" | |
strip tools/gs-netcat | |
if [ "${{ matrix.upx }}" != '' ]; then | |
upx tools/gs-netcat | |
fi | |
mv tools/gs-netcat tools/gs-netcat_mini-linux-${{ matrix.arch }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gsnc | |
path: tools/gs-netcat_mini-linux-${{ matrix.arch }} | |
deploy: | |
needs: [Linux-Cross-Compile, MacOS, OpenBSD, FreeBSD] | |
name: Deploy to gsocket.io | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: /tmp | |
- name: Deploy to gsocket.io/bin | |
env: | |
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | |
run: | | |
mkdir ~/.ssh && echo "$SSH_DEPLOY_KEY" >~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519 | |
cd /tmp | |
git clone -b gh-pages --single-branch [email protected]:hackerschoice/gsocket.io.git | |
ls -alR /tmp/gsnc/ | |
cd gsocket.io/bin | |
mv /tmp/gsnc/gs-netcat_* . | |
git config --local user.name "GitHub Action" | |
git config --local user.email "[email protected]" | |
git add gs-netcat_* && git commit -m "stealth binary" && git push | |