Skip to content

Commit

Permalink
CheckOutThis
Browse files Browse the repository at this point in the history
  • Loading branch information
Veha0001 committed Dec 1, 2024
1 parent 10bbb51 commit f589c49
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/php-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Build and Publish PHP Binaries for Android
on:
workflow_dispatch:
inputs:
php-version-base:
description: "PHP base version"
default: "8.2"
required: true
type: string
pm-version:
description: "Major PocketMine-MP version specified (can be 4 or 5)"
required: true
Expand All @@ -19,16 +24,16 @@ on:

jobs:
build-android:
name: Build PHP for Android-PM${{ inputs.pm-version }}
runs-on: ubuntu-22.04
name: Build PHP ${{ inputs.php-version-base }} for Android-PM${{ inputs.pm-version }}
runs-on: ubuntu-latest
env:
MUSL_DAT: https://github.com/${{ inputs.musl-repo }}/releases/download/build-tc/musl-cross-make-toolchain.tar.xz

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clone pmmp/PHP-Binaries repository
run: git clone https://github.com/pmmp/PHP-Binaries
with:
repository: "pmmp/PHP-Binaries"
- name: Install tools and dependencies
run: |
sudo apt-get update
Expand All @@ -44,7 +49,7 @@ jobs:
run: |
set -ex
trap "exit 1" ERR
./PHP-Binaries/compile.sh -t android-aarch64 -x -g -j 4 -P ${{ inputs.pm-version }}
./compile.sh -t android-aarch64 -x -g -j 4 -P ${{ inputs.pm-version }} -z ${{ inputs.php-version-base }}
- name: Create tarball
run: |
Expand All @@ -61,7 +66,7 @@ jobs:
uses: softprops/action-gh-release@v2
with:
files: ./PHP-Android-aarch64-PM${{ inputs.pm-version }}.tar.gz
name: PHP PM${{ inputs.pm-version }} (Build ${{ github.run_number }}) # Title for the release
name: PHP ${{ inputs.php-version-base }} PM${{ inputs.pm-version }} (Build ${{ github.run_number }}) # Title for the release
tag_name: php-pm${{ inputs.pm-version }}-build-${{ github.run_number }} # Tag for the release
body: |
## PHP PM${{ inputs.pm-version }} Release
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/toolchain-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,34 @@ jobs:
CFLAG: -march=x86-64 -Os
steps:
- uses: actions/checkout@v4
- name: Clone pmmp/musl-cross-make repository
run: git clone https://github.com/pmmp/musl-cross-make
with:
repository: "pmmp/musl-cross-make"

- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential musl-tools gcc-aarch64-linux-gnu wget curl
- name: Cache Make
- name: Cache Sources
uses: actions/cache@v4
with:
path: musl-cross-make
key: musl-cross-make-${{ hashFiles('musl-cross-make.hash') }}
restore-keys: musl-cross-make-
path: sources
key: ${{ runner.os }}-sources_tc-${{ hashFiles('hashes/*.sha1') }}
restore-keys: |
${{ runner.os }}-sources_tc-
- name: Create custom config.mak
run: |
cp musl-cross-make/config.mak.dist musl-cross-make/config.mak
echo 'OUTPUT="/opt/cross/"' >> musl-cross-make/config.mak
echo 'COMMON_CONFIG += CFLAGS="${{ env.CFLAG }}" CXXFLAGS="${{ env.CFLAG }}" ' >> musl-cross-make/config.mak
cp config.mak.dist config.mak
echo 'OUTPUT="/opt/cross/"' >> config.mak
echo 'COMMON_CONFIG += CFLAGS="${}" CXXFLAGS="${{ env.CFLAG }}" ' >> config.mak
- name: Build musl-cross-make
run: make -C musl-cross-make
run: make
continue-on-error: false

- name: Install musl-cross-make toolchain
run: sudo make install -C musl-cross-make
run: sudo make install

- name: Create tarball of the toolchain
run: sudo tar -cJvf musl-cross-make-toolchain.tar.xz -C /opt/cross/ .
Expand Down

0 comments on commit f589c49

Please sign in to comment.