This commit is contained in:
root 2023-02-22 12:59:12 +00:00
parent bfdc8f494a
commit 7b6807ae66
2 changed files with 151 additions and 0 deletions
.github/workflows
build/targets

68
.github/workflows/build-conntrack.yml vendored Normal file
View file

@ -0,0 +1,68 @@
name: socat
on:
workflow_dispatch
jobs:
build-x86_64:
name: Build socat x86_64
runs-on: ubuntu-latest
container: muslcc/x86_64:x86_64-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh
- name: Install testing dependencies
run: apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing yodl
- name: Build socat
id: build_socat
run: $GITHUB_WORKSPACE/build/targets/build_socat.sh x86_64
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ steps.build_socat.outputs.PACKAGED_NAME }}
path: ${{ steps.build_socat.outputs.PACKAGED_NAME_PATH }}
create-release:
name: Create socat Release
runs-on: ubuntu-latest
needs: [build-x86_64]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare Environment
run: mkdir /tmp/releases
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
path: /tmp/releases
- name: List Artifacts
run: ls -laR /tmp/releases
- name: Tag Release
id: tag_release
run: |
set +e
if git rev-list "conntrack-v${{ needs.build-x86.outputs.version }}".. >/dev/null;then
echo "Tag for conntrack-v${{ needs.build-x86.outputs.version }} already exists. Skipping release creation."
echo ::set-output name=NEW_RELEASE::"false"
else
git tag "conntrack-v${{ needs.build-x86.outputs.version }}"
git push origin "conntrack-v${{ needs.build-x86.outputs.version }}"
echo ::set-output name=NEW_RELEASE::"true"
fi
- name: Create Release
uses: ncipollo/release-action@v1
if: ${{ steps.tag_release.outputs.NEW_RELEASE == 'true' }}
with:
name: conntrack-v${{ needs.build-x86.outputs.version }}
tag: conntrack-v${{ needs.build-x86.outputs.version }}
artifacts: "/tmp/releases/*/*"
token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -0,0 +1,83 @@
#!/bin/bash
if [ -z "$GITHUB_WORKSPACE" ];then
echo "GITHUB_WORKSPACE environemnt variable not set!"
exit 1
fi
if [ "$#" -ne 1 ];then
echo "Usage: ${0} [x86|x86_64|armhf|aarch64]"
echo "Example: ${0} x86_64"
exit 1
fi
set -e
set -o pipefail
set -x
source $GITHUB_WORKSPACE/build/lib.sh
init_lib "$1"
build_conntrack() {
libmnl=1.0.5
libnfnetlink=1.0.2
libnetfilter_conntrack=1.0.9
libnetfilter_cttimeout=1.0.1
libnetfilter_queue=1.0.5
libnetfilter_cthelper=1.0.1
conntrack=1.4.7
wget https://www.netfilter.org/projects/libmnl/files/libmnl-${libmnl}.tar.bz2
wget https://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${libnfnetlink}.tar.bz2
wget https://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-${libnetfilter_conntrack}.tar.bz2
wget https://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${libnetfilter_cttimeout}.tar.bz2
wget https://www.netfilter.org/projects/libnetfilter_queue/files/libnetfilter_queue-${libnetfilter_queue}.tar.bz2
wget https://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${libnetfilter_cthelper}.tar.bz2
wget https://www.netfilter.org/projects/conntrack-tools/files/conntrack-tools-${conntrack}.tar.bz2
tar xvf libmnl-${libmnl}.tar.bz2
cd libmnl-${libmnl} && ./configure --enable-static && make -j $(nproc)
make install
cd ..
tar xvf libnfnetlink-${libnfnetlink}.tar.bz2
cd libnfnetlink-${libnfnetlink} && ./configure --enable-static && make -j $(nproc)
make install
cd ..
tar xvf libnetfilter_conntrack-${libnetfilter_conntrack}.tar.bz2
cd libnetfilter_conntrack-${libnetfilter_conntrack} && ./configure --enable-static && make -j $(nproc)
make install
cd ..
tar xvf libnetfilter_cttimeout-${libnetfilter_cttimeout}.tar.bz2
cd libnetfilter_cttimeout-${libnetfilter_cttimeout} && ./configure --enable-static && make -j $(nproc)
make install
cd ..
tar xvf libnetfilter_queue-${libnetfilter_queue}.tar.bz2
cd libnetfilter_queue-${libnetfilter_queue} && ./configure --enable-static && make -j $(nproc)
make install
cd ..
tar xvf libnetfilter_cthelper-${libnetfilter_cthelper}.tar.bz2
cd libnetfilter_cthelper-${libnetfilter_cthelper} && ./configure --enable-static && make -j $(nproc)
make install
cd ..
tar xvf conntrack-tools-${conntrack}.tar.bz2
cd conntrack-tools-${conntrack}
./configure && make -j $(nproc)
}
main() {
build_conntrack
local version
version=1.4
version_number=17
cp "${BUILD_DIRECTORY}/conntrack-tools-1.4.7/src/conntrack" "${OUTPUT_DIRECTORY}/conntrack${version}"
echo "[+] Finished building conntrack ${CURRENT_ARCH}"
echo ::set-output name=PACKAGED_NAME::"conntrack${version}"
echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*"
echo ::set-output name=PACKAGED_VERSION::"${version_number}"
}
main