Updated build system
This commit is contained in:
parent
edcd01d4df
commit
8d5d443792
2 changed files with 4 additions and 130 deletions
126
.github/workflows/ncc_workflow.yml
vendored
126
.github/workflows/ncc_workflow.yml
vendored
|
@ -58,55 +58,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: release
|
name: release
|
||||||
path: build/release/net.nosial.loglib.ncc
|
path: build/release/net.nosial.loglib.ncc
|
||||||
release_static:
|
|
||||||
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 -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: Build project
|
|
||||||
run: |
|
|
||||||
ncc build --config release_static --log-level debug
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: release_static
|
|
||||||
path: build/release/net.nosial.loglib_static.ncc
|
|
||||||
release-compressed:
|
release-compressed:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
|
@ -254,55 +205,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: release-executable
|
name: release-executable
|
||||||
path: build/release/release_executable_gz
|
path: build/release/release_executable_gz
|
||||||
release_static-executable:
|
|
||||||
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 -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: Build project
|
|
||||||
run: |
|
|
||||||
ncc build --config release_static-executable --log-level debug
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: release_static-executable
|
|
||||||
path: build/release/release_static_executable_gz
|
|
||||||
release-compressed-executable:
|
release-compressed-executable:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
|
@ -471,7 +373,7 @@ jobs:
|
||||||
path: docs.zip
|
path: docs.zip
|
||||||
|
|
||||||
test:
|
test:
|
||||||
needs: [release, release_static, release-compressed, debug-compressed, release-executable, release_static-executable, release-compressed-executable, debug-compressed-executable, check-phpunit]
|
needs: [release, release-compressed, debug-compressed, release-executable, release-compressed-executable, debug-compressed-executable, check-phpunit]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: php:8.3
|
image: php:8.3
|
||||||
|
@ -565,7 +467,7 @@ jobs:
|
||||||
|
|
||||||
|
|
||||||
release-artifacts:
|
release-artifacts:
|
||||||
needs: [release, release_static, release-compressed, debug-compressed, release-executable, release_static-executable, release-compressed-executable, debug-compressed-executable]
|
needs: [release, release-compressed, debug-compressed, release-executable, release-compressed-executable, debug-compressed-executable]
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
|
@ -588,18 +490,6 @@ jobs:
|
||||||
release/*
|
release/*
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Download release_static artifact
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: release_static
|
|
||||||
path: release_static
|
|
||||||
- name: Upload release_static artifact to release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
release_static/*
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Download release-compressed artifact
|
- name: Download release-compressed artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
@ -636,18 +526,6 @@ jobs:
|
||||||
release-executable/*
|
release-executable/*
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Download release_static-executable artifact
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: release_static-executable
|
|
||||||
path: release_static-executable
|
|
||||||
- name: Upload release_static-executable artifact to release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
release_static-executable/*
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Download release-compressed-executable artifact
|
- name: Download release-compressed-executable artifact
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|
8
Makefile
8
Makefile
|
@ -3,21 +3,17 @@ DEFAULT_CONFIGURATION ?= release
|
||||||
LOG_LEVEL = debug
|
LOG_LEVEL = debug
|
||||||
|
|
||||||
# Default Target
|
# Default Target
|
||||||
all: release release_static release-compressed debug-compressed release-executable release_static-executable release-compressed-executable debug-compressed-executable
|
all: release release-compressed debug-compressed release-executable release-compressed-executable debug-compressed-executable
|
||||||
|
|
||||||
# Build Steps
|
# Build Steps
|
||||||
release:
|
release:
|
||||||
ncc build --config=release --log-level $(LOG_LEVEL)
|
ncc build --config=release --log-level $(LOG_LEVEL)
|
||||||
release_static:
|
|
||||||
ncc build --config=release_static --log-level $(LOG_LEVEL)
|
|
||||||
release-compressed:
|
release-compressed:
|
||||||
ncc build --config=release-compressed --log-level $(LOG_LEVEL)
|
ncc build --config=release-compressed --log-level $(LOG_LEVEL)
|
||||||
debug-compressed:
|
debug-compressed:
|
||||||
ncc build --config=debug-compressed --log-level $(LOG_LEVEL)
|
ncc build --config=debug-compressed --log-level $(LOG_LEVEL)
|
||||||
release-executable:
|
release-executable:
|
||||||
ncc build --config=release-executable --log-level $(LOG_LEVEL)
|
ncc build --config=release-executable --log-level $(LOG_LEVEL)
|
||||||
release_static-executable:
|
|
||||||
ncc build --config=release_static-executable --log-level $(LOG_LEVEL)
|
|
||||||
release-compressed-executable:
|
release-compressed-executable:
|
||||||
ncc build --config=release-compressed-executable --log-level $(LOG_LEVEL)
|
ncc build --config=release-compressed-executable --log-level $(LOG_LEVEL)
|
||||||
debug-compressed-executable:
|
debug-compressed-executable:
|
||||||
|
@ -34,4 +30,4 @@ test: release
|
||||||
clean:
|
clean:
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
|
||||||
.PHONY: all install test clean release release_static release-compressed debug-compressed release-executable release_static-executable release-compressed-executable debug-compressed-executable
|
.PHONY: all install test clean release release-compressed debug-compressed release-executable release-compressed-executable debug-compressed-executable
|
Loading…
Add table
Reference in a new issue