diff --git a/.github/workflows/ncc_workflow.yml b/.github/workflows/ncc_workflow.yml index 4129c5e..6fcb0d4 100644 --- a/.github/workflows/ncc_workflow.yml +++ b/.github/workflows/ncc_workflow.yml @@ -11,7 +11,7 @@ on: jobs: - build-release: + release: runs-on: ubuntu-latest container: image: php:8.3 @@ -61,7 +61,7 @@ jobs: name: release path: build/release/net.nosial.tgbotlib.ncc - build-release-compressed: + release-compressed: runs-on: ubuntu-latest container: image: php:8.3 @@ -111,7 +111,7 @@ jobs: name: release-compressed path: build/release/net.nosial.tgbotlib.gz.ncc - build-release-executable: + release-executable: runs-on: ubuntu-latest container: image: php:8.3 @@ -161,6 +161,58 @@ jobs: name: release-executable path: build/release/TgBotLib + release-executable-compressed: + runs-on: ubuntu-latest + container: + image: php:8.3 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install dependencies + run: | + apt update -yqq + apt install git libpq-dev libzip-dev zip make wget gnupg gcc -yqq + + - name: Install phive + run: | + wget -O phive.phar https://phar.io/releases/phive.phar + wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc + gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 + gpg --verify phive.phar.asc phive.phar + chmod +x phive.phar + mv phive.phar /usr/local/bin/phive + + - name: Install phab + run: | + phive install phpab --global --trust-gpg-keys 0x2A8299CE842DD38C + + - name: Install latest version of NCC + run: | + git clone https://git.n64.cc/nosial/ncc.git + cd ncc + make redist + NCC_DIR=$(find build/ -type d -name "ncc_*" | head -n 1) + if [ -z "$NCC_DIR" ]; then + echo "NCC build directory not found" + exit 1 + fi + php "$NCC_DIR/INSTALL" --auto + cd .. && rm -rf ncc + + - name: Compile Project + run: | + ncc build --config release-executable-compressed --log-level debug + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: release-executable-compressed + path: build/release/TgBotLib_gz + + + check-phpunit: runs-on: ubuntu-latest outputs: @@ -194,7 +246,7 @@ jobs: fi generate_phpdoc: - needs: [build-release, build-release-compressed, build-release-executable, check-phpdoc] + needs: [release, release-compressed, release-executable, check-phpdoc] runs-on: ubuntu-latest container: image: php:8.3 @@ -225,7 +277,7 @@ jobs: path: docs test: - needs: [build-release, build-release-compressed, build-release-executable, check-phpunit] + needs: [release, release-compressed, release-executable, check-phpunit] runs-on: ubuntu-latest container: image: php:8.3 @@ -277,7 +329,7 @@ jobs: - name: Install NCC packages run: | - ncc package install --package="TgBotLib_build/net.nosial.tgbotlib.ncc" --build-source --reinstall -y --log-level debug + ncc package install --package="release/net.nosial.tgbotlib.ncc" --source --reinstall -y --log-level debug - name: Create token.txt run: echo "${{ secrets.TELEGRAM_TEST_TOKEN }}" > tests/token.txt @@ -288,7 +340,7 @@ jobs: php phpunit-11.3.phar --configuration phpunit.xml release: - needs: [build-release, build-release-compressed, build-release-executable, test] + needs: [release, release-compressed, release-executable, test] permissions: write-all runs-on: ubuntu-latest container: diff --git a/project.json b/project.json index ebcfba6..436e545 100644 --- a/project.json +++ b/project.json @@ -57,7 +57,7 @@ { "name": "release-executable-compressed", "build_type": "executable", - "output": "build/release/%ASSEMBLY.NAME%.gz", + "output": "build/release/%ASSEMBLY.NAME%_gz", "options": { "ncc_configuration": "release-compressed" }