From ceb2f8103893cf1710f2b1b15b97e86b60312582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=93=99=F0=9D=93=BE=F0=9D=93=B5=F0=9D=93=B2?= =?UTF-8?q?=F0=9D=93=B8?= Date: Sun, 1 Sep 2024 05:01:01 +0200 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 40 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77e8d0a..f910e3e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,4 @@ name: Build and Publish NGINX - on: push: branches: @@ -7,33 +6,27 @@ on: pull_request: branches: - main - jobs: build: runs-on: ubuntu-22.04 - steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Install dependencies run: | sudo apt-get update sudo apt-get -y install git dpkg-dev - - name: Clone the repository run: | cd /root/ git clone https://github.com/theraw/The-World-Is-Yours.git cd The-World-Is-Yours/ - - name: Build NGINX run: | cd /root/The-World-Is-Yours/ sudo bash build/run.sh new sudo bash build/run.sh build sudo bash build/run.sh postfix - - name: Build .deb Package run: | cd /root/The-World-Is-Yours/ @@ -56,17 +49,14 @@ jobs: mkdir -p ${PKG_DIR}/usr/local/lib mkdir -p ${PKG_DIR}/hostdata/default/public_html mkdir -p ${PKG_DIR}/usr/nginx_lua - cp /usr/sbin/nginx ${PKG_DIR}/usr/sbin/ cp -R /nginx/* ${PKG_DIR}/nginx/ cp /etc/systemd/system/nginx.service ${PKG_DIR}/etc/systemd/system/ cp -R /hostdata/default ${PKG_DIR}/hostdata/ cp -R /usr/nginx_lua ${PKG_DIR}/usr/ - for lib in $(ldd /usr/sbin/nginx | grep "=> /" | awk "{print \$3}"); do cp "$lib" "${PKG_DIR}/usr/lib/" done - for module in /opt/mod/*; do if [ -f "$module" ]; then for lib in $(ldd "$module" | grep "=> /" | awk "{print \$3}"); do @@ -74,31 +64,23 @@ jobs: done fi done - mkdir -p ${DEB_DIR} - cat < ${DEB_DIR}/control -Package: ${PKG_NAME} -Version: ${VERSION} -Section: base -Priority: optional -Architecture: ${ARCH} -Maintainer: theraw -Description: Custom NGINX build -EOL - - cat <<'POSTINST_EOF' > ${DEB_DIR}/postinst -#!/bin/bash -useradd -r -d /usr/local/nginx -s /bin/false nginx || true -POSTINST_EOF + echo "Package: ${PKG_NAME}" > ${DEB_DIR}/control + echo "Version: ${VERSION}" >> ${DEB_DIR}/control + echo "Section: base" >> ${DEB_DIR}/control + echo "Priority: optional" >> ${DEB_DIR}/control + echo "Architecture: ${ARCH}" >> ${DEB_DIR}/control + echo "Maintainer: theraw " >> ${DEB_DIR}/control + echo "Description: Custom NGINX build with modules and dependencies" >> ${DEB_DIR}/control + cat <<'EOF' > ${DEB_DIR}/postinst + #!/bin/bash + useradd -r -d /usr/local/nginx -s /bin/false nginx || true + EOF chmod 755 ${DEB_DIR}/postinst - dpkg-deb --build ${PKG_DIR} - mv ${PKG_DIR}.deb /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb - echo "Debian package created at /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb" }; create_deb' - - name: Upload .deb Package as Artifact uses: actions/upload-artifact@v3 with: