Updated build
This commit is contained in:
parent
a116697e24
commit
88f1ebddeb
2 changed files with 60 additions and 8 deletions
66
.github/workflows/ncc_workflow.yml
vendored
66
.github/workflows/ncc_workflow.yml
vendored
|
@ -11,7 +11,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
|
||||||
build-release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: php:8.3
|
image: php:8.3
|
||||||
|
@ -61,7 +61,7 @@ jobs:
|
||||||
name: release
|
name: release
|
||||||
path: build/release/net.nosial.tgbotlib.ncc
|
path: build/release/net.nosial.tgbotlib.ncc
|
||||||
|
|
||||||
build-release-compressed:
|
release-compressed:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: php:8.3
|
image: php:8.3
|
||||||
|
@ -111,7 +111,7 @@ jobs:
|
||||||
name: release-compressed
|
name: release-compressed
|
||||||
path: build/release/net.nosial.tgbotlib.gz.ncc
|
path: build/release/net.nosial.tgbotlib.gz.ncc
|
||||||
|
|
||||||
build-release-executable:
|
release-executable:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: php:8.3
|
image: php:8.3
|
||||||
|
@ -161,6 +161,58 @@ jobs:
|
||||||
name: release-executable
|
name: release-executable
|
||||||
path: build/release/TgBotLib
|
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:
|
check-phpunit:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
|
@ -194,7 +246,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
generate_phpdoc:
|
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
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: php:8.3
|
image: php:8.3
|
||||||
|
@ -225,7 +277,7 @@ jobs:
|
||||||
path: docs
|
path: docs
|
||||||
|
|
||||||
test:
|
test:
|
||||||
needs: [build-release, build-release-compressed, build-release-executable, check-phpunit]
|
needs: [release, release-compressed, release-executable, check-phpunit]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: php:8.3
|
image: php:8.3
|
||||||
|
@ -277,7 +329,7 @@ jobs:
|
||||||
|
|
||||||
- name: Install NCC packages
|
- name: Install NCC packages
|
||||||
run: |
|
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
|
- name: Create token.txt
|
||||||
run: echo "${{ secrets.TELEGRAM_TEST_TOKEN }}" > tests/token.txt
|
run: echo "${{ secrets.TELEGRAM_TEST_TOKEN }}" > tests/token.txt
|
||||||
|
@ -288,7 +340,7 @@ jobs:
|
||||||
php phpunit-11.3.phar --configuration phpunit.xml
|
php phpunit-11.3.phar --configuration phpunit.xml
|
||||||
|
|
||||||
release:
|
release:
|
||||||
needs: [build-release, build-release-compressed, build-release-executable, test]
|
needs: [release, release-compressed, release-executable, test]
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
{
|
{
|
||||||
"name": "release-executable-compressed",
|
"name": "release-executable-compressed",
|
||||||
"build_type": "executable",
|
"build_type": "executable",
|
||||||
"output": "build/release/%ASSEMBLY.NAME%.gz",
|
"output": "build/release/%ASSEMBLY.NAME%_gz",
|
||||||
"options": {
|
"options": {
|
||||||
"ncc_configuration": "release-compressed"
|
"ncc_configuration": "release-compressed"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue