diff --git a/.github/workflows/php-ci.yml b/.github/workflows/php-ci.yml index 7c00f96..6df6043 100644 --- a/.github/workflows/php-ci.yml +++ b/.github/workflows/php-ci.yml @@ -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 @@ -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 @@ -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: | @@ -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 diff --git a/.github/workflows/toolchain-ci.yml b/.github/workflows/toolchain-ci.yml index c08e7e8..c387ad9 100644 --- a/.github/workflows/toolchain-ci.yml +++ b/.github/workflows/toolchain-ci.yml @@ -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/ .