Update main.yml
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
name: Build and Publish NGINX
|
name: Build and Publish NGINX
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
@@ -7,33 +6,27 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install git dpkg-dev
|
sudo apt-get -y install git dpkg-dev
|
||||||
|
|
||||||
- name: Clone the repository
|
- name: Clone the repository
|
||||||
run: |
|
run: |
|
||||||
cd $HOME
|
cd $HOME
|
||||||
git clone https://github.com/theraw/The-World-Is-Yours.git
|
git clone https://github.com/theraw/The-World-Is-Yours.git
|
||||||
cd The-World-Is-Yours/
|
cd The-World-Is-Yours/
|
||||||
|
|
||||||
- name: Build NGINX
|
- name: Build NGINX
|
||||||
run: |
|
run: |
|
||||||
cd $HOME/The-World-Is-Yours/
|
cd $HOME/The-World-Is-Yours/
|
||||||
sudo bash build/run.sh new
|
sudo bash build/run.sh new
|
||||||
sudo bash build/run.sh build
|
sudo bash build/run.sh build
|
||||||
sudo bash build/run.sh postfix
|
sudo bash build/run.sh postfix
|
||||||
|
|
||||||
- name: Build .deb Package
|
- name: Build .deb Package
|
||||||
run: |
|
run: |
|
||||||
cd $HOME/The-World-Is-Yours/
|
cd $HOME/The-World-Is-Yours/
|
||||||
@@ -43,7 +36,6 @@ jobs:
|
|||||||
ARCH="amd64"
|
ARCH="amd64"
|
||||||
PKG_DIR="/opt/${PKG_NAME}_${VERSION}_${ARCH}"
|
PKG_DIR="/opt/${PKG_NAME}_${VERSION}_${ARCH}"
|
||||||
DEB_DIR="${PKG_DIR}/DEBIAN"
|
DEB_DIR="${PKG_DIR}/DEBIAN"
|
||||||
|
|
||||||
mkdir -p ${PKG_DIR}/usr/sbin
|
mkdir -p ${PKG_DIR}/usr/sbin
|
||||||
mkdir -p ${PKG_DIR}/usr/local/nginx
|
mkdir -p ${PKG_DIR}/usr/local/nginx
|
||||||
mkdir -p ${PKG_DIR}/nginx
|
mkdir -p ${PKG_DIR}/nginx
|
||||||
@@ -56,17 +48,14 @@ jobs:
|
|||||||
mkdir -p ${PKG_DIR}/usr/local/lib
|
mkdir -p ${PKG_DIR}/usr/local/lib
|
||||||
mkdir -p ${PKG_DIR}/hostdata/default/public_html
|
mkdir -p ${PKG_DIR}/hostdata/default/public_html
|
||||||
mkdir -p ${PKG_DIR}/usr/nginx_lua
|
mkdir -p ${PKG_DIR}/usr/nginx_lua
|
||||||
|
|
||||||
cp /usr/sbin/nginx ${PKG_DIR}/usr/sbin/
|
cp /usr/sbin/nginx ${PKG_DIR}/usr/sbin/
|
||||||
cp -R /nginx/* ${PKG_DIR}/nginx/
|
cp -R /nginx/* ${PKG_DIR}/nginx/
|
||||||
cp /etc/systemd/system/nginx.service ${PKG_DIR}/etc/systemd/system/
|
cp /etc/systemd/system/nginx.service ${PKG_DIR}/etc/systemd/system/
|
||||||
cp -R /hostdata/default ${PKG_DIR}/hostdata/
|
cp -R /hostdata/default ${PKG_DIR}/hostdata/
|
||||||
cp -R /usr/nginx_lua ${PKG_DIR}/usr/
|
cp -R /usr/nginx_lua ${PKG_DIR}/usr/
|
||||||
|
|
||||||
for lib in $(ldd /usr/sbin/nginx | grep "=> /" | awk "{print \$3}"); do
|
for lib in $(ldd /usr/sbin/nginx | grep "=> /" | awk "{print \$3}"); do
|
||||||
cp "$lib" "${PKG_DIR}/usr/lib/"
|
cp "$lib" "${PKG_DIR}/usr/lib/"
|
||||||
done
|
done
|
||||||
|
|
||||||
for module in /opt/mod/*; do
|
for module in /opt/mod/*; do
|
||||||
if [ -f "$module" ]; then
|
if [ -f "$module" ]; then
|
||||||
for lib in $(ldd "$module" | grep "=> /" | awk "{print \$3}"); do
|
for lib in $(ldd "$module" | grep "=> /" | awk "{print \$3}"); do
|
||||||
@@ -74,27 +63,22 @@ jobs:
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
mkdir -p ${DEB_DIR}
|
mkdir -p ${DEB_DIR}
|
||||||
echo "Package: ${PKG_NAME}" > ${DEB_DIR}/control
|
echo "Package: ${PKG_NAME}" > ${DEB_DIR}/control
|
||||||
echo "Version: ${VERSION}" >> ${DEB_DIR}/control
|
echo "Version: ${VERSION}" >> ${DEB_DIR}/control
|
||||||
echo "Section: base" >> ${DEB_DIR}/control
|
echo "Section: base" >> ${DEB_DIR}/control
|
||||||
echo "Priority: optional" >> ${DEB_DIR}/control
|
echo "Priority: optional" >> ${DEB_DIR}/control
|
||||||
echo "Architecture: ${ARCH}" >> ${DEB_DIR}/control
|
echo "Architecture: ${ARCH}" >> ${DEB_DIR}/control
|
||||||
echo "Maintainer: You <you@example.com>" >> ${DEB_DIR}/control
|
echo "Maintainer: Julio <me@julio.al>" >> ${DEB_DIR}/control
|
||||||
echo "Description: Custom NGINX build with modules and dependencies" >> ${DEB_DIR}/control
|
echo "Description: Nginx L7 DDoS Protection! And many more features github.com/theraw/The-World-Is-Yours" >> ${DEB_DIR}/control
|
||||||
|
|
||||||
echo "#!/bin/bash" > ${DEB_DIR}/postinst
|
echo "#!/bin/bash" > ${DEB_DIR}/postinst
|
||||||
echo "useradd -r -d /usr/local/nginx -s /bin/false nginx || true" >> ${DEB_DIR}/postinst
|
echo "useradd -r -d /usr/local/nginx -s /bin/false nginx || true" >> ${DEB_DIR}/postinst
|
||||||
chmod 755 ${DEB_DIR}/postinst
|
chmod 755 ${DEB_DIR}/postinst
|
||||||
|
chmod -R 0755 ${DEB_DIR}
|
||||||
dpkg-deb --build ${PKG_DIR}
|
dpkg-deb --build ${PKG_DIR}
|
||||||
|
|
||||||
mv ${PKG_DIR}.deb /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb
|
mv ${PKG_DIR}.deb /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb
|
||||||
|
|
||||||
echo "Debian package created at /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb"
|
echo "Debian package created at /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb"
|
||||||
}; create_deb'
|
}; create_deb'
|
||||||
|
|
||||||
- name: Upload .deb Package as Artifact
|
- name: Upload .deb Package as Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user