From 14a7a13738db429efbd5d1a03fa624ffcc9a54b3 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:11:13 +0200 Subject: [PATCH 01/10] Create main.yml --- .github/workflows/main.yml | 93 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6b88924 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,93 @@ +name: Build and Publish NGINX + +on: + push: + branches: + - main + 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 -y update + sudo apt-get -y install git dpkg-dev build-essential + + - name: Clone the repository + run: | + git clone https://github.com/theraw/The-World-Is-Yours.git $GITHUB_WORKSPACE/The-World-Is-Yours + + - name: Build NGINX + run: | + cd $GITHUB_WORKSPACE/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 $GITHUB_WORKSPACE/The-World-Is-Yours + sudo bash -c ' + PKG_NAME="twiy" + VERSION=$(nginx -v 2>&1 | awk -F"/" "{print \$2}") + ARCH="amd64" + PKG_DIR="$GITHUB_WORKSPACE/${PKG_NAME}_${VERSION}_${ARCH}" + DEB_DIR="${PKG_DIR}/DEBIAN" + + mkdir -p ${PKG_DIR}/usr/sbin + mkdir -p ${PKG_DIR}/usr/local/nginx + mkdir -p ${PKG_DIR}/nginx + mkdir -p ${PKG_DIR}/etc/systemd/system + mkdir -p ${PKG_DIR}/var/log/nginx + mkdir -p ${PKG_DIR}/nginx/conf.d + mkdir -p ${PKG_DIR}/nginx/live + mkdir -p ${PKG_DIR}/nginx/modsec + mkdir -p ${PKG_DIR}/usr/lib + 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 + cp "$lib" "${PKG_DIR}/usr/lib/" + done + fi + done + mkdir -p ${DEB_DIR} + 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 $GITHUB_WORKSPACE/${PKG_NAME}_${VERSION}_${ARCH}.deb + echo "Debian package created at $GITHUB_WORKSPACE/${PKG_NAME}_${VERSION}_${ARCH}.deb" + ' + + - name: Upload .deb Package as Artifact + uses: actions/upload-artifact@v3 + with: + name: twiy-nginx-deb + path: $GITHUB_WORKSPACE/*.deb From 2a57da27dd33c1c3f55ae133fe9151c50c3e0ee3 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:12:52 +0200 Subject: [PATCH 02/10] Update main.yml --- .github/workflows/main.yml | 125 ++++++++++++++++++++----------------- 1 file changed, 69 insertions(+), 56 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6b88924..fb0bb4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,83 +11,96 @@ on: jobs: build: runs-on: ubuntu-22.04 + steps: - name: Checkout repository uses: actions/checkout@v3 - name: Install dependencies run: | - sudo apt-get -y update - sudo apt-get -y install git dpkg-dev build-essential + sudo apt-get update + sudo apt-get -y install git dpkg-dev - name: Clone the repository run: | - git clone https://github.com/theraw/The-World-Is-Yours.git $GITHUB_WORKSPACE/The-World-Is-Yours + cd /root/ + git clone https://github.com/theraw/The-World-Is-Yours.git + cd The-World-Is-Yours/ - name: Build NGINX run: | - cd $GITHUB_WORKSPACE/The-World-Is-Yours + 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 $GITHUB_WORKSPACE/The-World-Is-Yours - sudo bash -c ' - PKG_NAME="twiy" - VERSION=$(nginx -v 2>&1 | awk -F"/" "{print \$2}") - ARCH="amd64" - PKG_DIR="$GITHUB_WORKSPACE/${PKG_NAME}_${VERSION}_${ARCH}" - DEB_DIR="${PKG_DIR}/DEBIAN" + cd /root/The-World-Is-Yours/ + sudo bash -c 'function create_deb() { + PKG_NAME="twiy" + VERSION=$(nginx -v 2>&1 | awk -F"/" "{print \$2}") + ARCH="amd64" + PKG_DIR="/opt/${PKG_NAME}_${VERSION}_${ARCH}" + DEB_DIR="${PKG_DIR}/DEBIAN" - mkdir -p ${PKG_DIR}/usr/sbin - mkdir -p ${PKG_DIR}/usr/local/nginx - mkdir -p ${PKG_DIR}/nginx - mkdir -p ${PKG_DIR}/etc/systemd/system - mkdir -p ${PKG_DIR}/var/log/nginx - mkdir -p ${PKG_DIR}/nginx/conf.d - mkdir -p ${PKG_DIR}/nginx/live - mkdir -p ${PKG_DIR}/nginx/modsec - mkdir -p ${PKG_DIR}/usr/lib - 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 - cp "$lib" "${PKG_DIR}/usr/lib/" - done - fi - done - mkdir -p ${DEB_DIR} - 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 $GITHUB_WORKSPACE/${PKG_NAME}_${VERSION}_${ARCH}.deb - echo "Debian package created at $GITHUB_WORKSPACE/${PKG_NAME}_${VERSION}_${ARCH}.deb" - ' + mkdir -p ${PKG_DIR}/usr/sbin + mkdir -p ${PKG_DIR}/usr/local/nginx + mkdir -p ${PKG_DIR}/nginx + mkdir -p ${PKG_DIR}/etc/systemd/system + mkdir -p ${PKG_DIR}/var/log/nginx + mkdir -p ${PKG_DIR}/nginx/conf.d + mkdir -p ${PKG_DIR}/nginx/live + mkdir -p ${PKG_DIR}/nginx/modsec + mkdir -p ${PKG_DIR}/usr/lib + 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 + cp "$lib" "${PKG_DIR}/usr/lib/" + done + fi + done + + mkdir -p ${DEB_DIR} + cat < ${DEB_DIR}/control +Package: ${PKG_NAME} +Version: ${VERSION} +Section: base +Priority: optional +Architecture: ${ARCH} +Maintainer: You +Description: Custom NGINX build with modules and dependencies +EOL + + cat <<'POSTINST_EOF' > ${DEB_DIR}/postinst +#!/bin/bash +useradd -r -d /usr/local/nginx -s /bin/false nginx || true +POSTINST_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: name: twiy-nginx-deb - path: $GITHUB_WORKSPACE/*.deb + path: /opt/*.deb From 14bc66eac332870bba26e4ebcc593791ba8967db 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:15:02 +0200 Subject: [PATCH 03/10] Update main.yml --- .github/workflows/main.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb0bb4f..ec28bcb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,20 +76,16 @@ jobs: done mkdir -p ${DEB_DIR} - cat < ${DEB_DIR}/control -Package: ${PKG_NAME} -Version: ${VERSION} -Section: base -Priority: optional -Architecture: ${ARCH} -Maintainer: You -Description: Custom NGINX build with modules and dependencies -EOL + 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: You " >> ${DEB_DIR}/control + echo "Description: Custom NGINX build with modules and dependencies" >> ${DEB_DIR}/control - cat <<'POSTINST_EOF' > ${DEB_DIR}/postinst -#!/bin/bash -useradd -r -d /usr/local/nginx -s /bin/false nginx || true -POSTINST_EOF + echo "#!/bin/bash" > ${DEB_DIR}/postinst + echo "useradd -r -d /usr/local/nginx -s /bin/false nginx || true" >> ${DEB_DIR}/postinst chmod 755 ${DEB_DIR}/postinst dpkg-deb --build ${PKG_DIR} From c8c4db0388cfa24578aaf5576d343ff36938e5cd 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:16:38 +0200 Subject: [PATCH 04/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec28bcb..5d1b51f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Build and Publish NGINX on: push: branches: - - main + - theraw-testrun pull_request: branches: - main From cd68adb0cd79873a15b5548d25d085ebaa7bee66 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:18:26 +0200 Subject: [PATCH 05/10] Update main.yml --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d1b51f..500eaac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,20 +23,20 @@ jobs: - name: Clone the repository run: | - cd /root/ + cd $HOME 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/ + cd $HOME/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/ + cd $HOME/The-World-Is-Yours/ sudo bash -c 'function create_deb() { PKG_NAME="twiy" VERSION=$(nginx -v 2>&1 | awk -F"/" "{print \$2}") From ebcd3a4d8c2a039a0049564265ad2c8b69de46f9 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:39:08 +0200 Subject: [PATCH 06/10] Update main.yml --- .github/workflows/main.yml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 500eaac..f948101 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 $HOME git clone https://github.com/theraw/The-World-Is-Yours.git cd The-World-Is-Yours/ - - name: Build NGINX run: | cd $HOME/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 $HOME/The-World-Is-Yours/ @@ -43,7 +36,6 @@ jobs: ARCH="amd64" PKG_DIR="/opt/${PKG_NAME}_${VERSION}_${ARCH}" DEB_DIR="${PKG_DIR}/DEBIAN" - mkdir -p ${PKG_DIR}/usr/sbin mkdir -p ${PKG_DIR}/usr/local/nginx mkdir -p ${PKG_DIR}/nginx @@ -56,17 +48,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,27 +63,22 @@ jobs: done fi done - mkdir -p ${DEB_DIR} 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: You " >> ${DEB_DIR}/control - echo "Description: Custom NGINX build with modules and dependencies" >> ${DEB_DIR}/control - + echo "Maintainer: Julio " >> ${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 "useradd -r -d /usr/local/nginx -s /bin/false nginx || true" >> ${DEB_DIR}/postinst chmod 755 ${DEB_DIR}/postinst - + chmod -R 0755 ${DEB_DIR} 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: From b6c8c9ce9640922a30e6b5e891758c8ef1ecca8a 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 06:04:42 +0200 Subject: [PATCH 07/10] Update main.yml --- .github/workflows/main.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f948101..b98a3a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,5 @@ name: Build and Publish NGINX + on: push: branches: @@ -6,27 +7,32 @@ 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 $HOME git clone https://github.com/theraw/The-World-Is-Yours.git cd The-World-Is-Yours/ + - name: Build NGINX run: | cd $HOME/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 $HOME/The-World-Is-Yours/ @@ -79,8 +85,11 @@ jobs: 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 + + - name: Upload .deb Package as Release Asset + uses: softprops/action-gh-release@v1 with: - name: twiy-nginx-deb - path: /opt/*.deb + files: /opt/*.deb + env: + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + RELEASE_TAG: v${{ steps.build.outputs.VERSION }} From 4f745516cdd517098516e5f1c15f6142e4e99ff6 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 06:20:03 +0200 Subject: [PATCH 08/10] Update main.yml --- .github/workflows/main.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b98a3a2..e6da781 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,10 +86,16 @@ jobs: echo "Debian package created at /opt/${PKG_NAME}_${VERSION}_${ARCH}.deb" }; create_deb' + - name: Create Git Tag + run: | + git config user.name "theraw" + git config user.email "raw@dopehosting.net" + git tag v${{ steps.build.outputs.VERSION }} + git push origin v${{ steps.build.outputs.VERSION }} + - name: Upload .deb Package as Release Asset uses: softprops/action-gh-release@v1 with: files: /opt/*.deb env: - GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} - RELEASE_TAG: v${{ steps.build.outputs.VERSION }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 201e399361ec6b297b82afc6d790461a33603e82 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 11:06:05 +0200 Subject: [PATCH 09/10] Update main.yml --- .github/workflows/main.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6da781..72cd60e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,6 +34,7 @@ jobs: sudo bash build/run.sh postfix - name: Build .deb Package + id: build_deb run: | cd $HOME/The-World-Is-Yours/ sudo bash -c 'function create_deb() { @@ -84,18 +85,20 @@ jobs: 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" + echo "::set-output name=VERSION::${VERSION}" }; create_deb' - name: Create Git Tag run: | + VERSION=${{ steps.build_deb.outputs.VERSION }} git config user.name "theraw" - git config user.email "raw@dopehosting.net" - git tag v${{ steps.build.outputs.VERSION }} - git push origin v${{ steps.build.outputs.VERSION }} + git config user.email "me@julio.al" + git tag v$VERSION + git push origin v$VERSION - name: Upload .deb Package as Release Asset uses: softprops/action-gh-release@v1 with: files: /opt/*.deb env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} From 7069b0e0d68ba1ea0f4cb679c699251bd0a4f42e 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 11:25:09 +0200 Subject: [PATCH 10/10] Update main.yml --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 72cd60e..7bad762 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -97,8 +97,9 @@ jobs: git push origin v$VERSION - name: Upload .deb Package as Release Asset - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: /opt/*.deb + tag_name: v${{ steps.build_deb.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}