Skip to content

Commit

Permalink
Add our own flavour
Browse files Browse the repository at this point in the history
  • Loading branch information
larryTheCoder authored and dries-c committed Feb 14, 2024
1 parent 4a39aae commit de67077
Show file tree
Hide file tree
Showing 5 changed files with 597 additions and 67 deletions.
100 changes: 41 additions & 59 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install tools and dependencies
run: |
sudo apt-get update
sudo apt-get install make autoconf automake libtool libtool-bin m4 wget libc-bin gzip bzip2 bison g++ git re2c
sudo apt-get install make autoconf automake libtool libtool-bin m4 curl libc-bin gzip bzip2 bison g++ git re2c ca-certificates
- name: Prepare compile.sh download cache
id: download-cache
Expand All @@ -40,20 +40,23 @@ jobs:
# Used "set -ex" instead of hashbang since script isn't executed with hashbang
set -ex
trap "exit 1" ERR
./compile.sh -t linux64 -j 4 -g -P ${{ matrix.pm-version-major }} -c ./download_cache -D
./compile.sh -t linux64 -j 4 -g -F -P ${{ matrix.pm-version-major }} -c ./download_cache -D
- name: Create tarball
run: |
tar -czf ./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}.tar.gz bin
tar -czf ./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}-debugging-symbols.tar.gz bin-debug
tar -czf ./PHP-Linux-x86_64.tar.gz bin
tar -czf ./PHP-Linux-x86_64-debugging-symbols.tar.gz bin-debug
cp ./PHP-Linux-x86_64.tar.gz ./PHP_Linux-x86_64.tar.gz
zip -r ./Linux.zip ./PHP_Linux-x86_64.tar.gz
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: Linux-PM${{ matrix.pm-version-major }}
path: |
./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}*.tar.gz
./Linux.zip
./PHP-Linux-x86_64*.tar.gz
install.log
compile.sh
if-no-files-found: error
Expand All @@ -80,10 +83,10 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install tools and dependencies
run: brew install libtool autoconf automake pkg-config bison re2c

- name: Prepare compile.sh download cache
id: download-cache
uses: actions/cache@v3
Expand All @@ -97,20 +100,20 @@ jobs:
export PATH="/usr/local/opt/bison/bin:$PATH"
set -ex
trap "exit 1" ERR
./compile.sh -t mac-x86-64 -j4 -g -P ${{ matrix.pm-version-major }} -c ./download_cache -D
./compile.sh -t mac-x86-64 -j4 -g -F -P ${{ matrix.pm-version-major }} -c ./download_cache -D
- name: Create tarball
run: |
tar -czf ./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}.tar.gz bin
tar -czf ./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}-debugging-symbols.tar.gz bin-debug
tar -czf ./PHP-MacOS-x86_64.tar.gz bin
tar -czf ./PHP-MacOS-x86_64-debugging-symbols.tar.gz bin-debug
- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: MacOS-PM${{ matrix.pm-version-major }}
path: |
./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}*.tar.gz
./PHP-MacOS-x86_64*.tar.gz
install.log
compile.sh
if-no-files-found: error
Expand All @@ -137,10 +140,10 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install tools and dependencies
run: choco install wget --no-progress

- name: Compile PHP
run: .\windows-compile-vs.bat
env:
Expand All @@ -151,8 +154,8 @@ jobs:
- name: Rename artifacts
run: |
mkdir temp
move php-debug-pack-*.zip temp/PHP-Windows-x64-PM${{ matrix.pm-version-major }}-debugging-symbols.zip
move php-*.zip temp/PHP-Windows-x64-PM${{ matrix.pm-version-major }}.zip
move php-debug-pack-*.zip temp/PHP-Windows-x64-debugging-symbols.zip
move php-*.zip temp/PHP-Windows-x64.zip
move temp\*.zip .
- name: Upload artifacts
Expand All @@ -174,71 +177,50 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set version information
id: version
run: |
echo PHP_VERSION=$(echo ${{ github.ref_name }} | cut -d / -f2) >> $GITHUB_OUTPUT
- name: Update latest tag target
run: |
git tag -f php-${{ steps.version.outputs.PHP_VERSION }}-latest
git push -f origin php-${{ steps.version.outputs.PHP_VERSION }}-latest
git tag -f ${{ steps.version.outputs.PHP_VERSION }}
git push -f origin ${{ steps.version.outputs.PHP_VERSION }}
git tag -f ${{ steps.version.outputs.PHP_VERSION }}-pm5
git push -f origin ${{ steps.version.outputs.PHP_VERSION }}-pm5
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}

- name: Generate release notes
run: |
echo "Last updated on **$(date -u +'%Y-%m-%d at %H:%M:%S %Z')**" > changelog.md
echo -e "\n\n" >> changelog.md
echo "Built by: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> changelog.md
if [[ "${{ github.ref_name }}" != "${{ github.event.repository.default_branch }}" ]]; then
echo -e "\n\n\n" >> changelog.md
if [[ "${{ github.ref_name }}" == *"preview" ]]; then
echo "# :warning: :radioactive: EXPERIMENTAL!!! :radioactive: :warning:" >> changelog.md
echo "### Your server and/or plugins may crash or misbehave with this release!" >> changelog.md
echo "### Consider downloading the [recommended release](${{ github.server_url }}/${{ github.repository }}/releases/latest) instead." >> changelog.md
else
echo ":warning: WARNING! :warning:" >> changelog.md
echo "Some plugins might not work properly on this version yet." >> changelog.md
echo "If you have problems, try the [recommended release](${{ github.server_url }}/${{ github.repository }}/releases/latest) instead." >> changelog.md
fi
else
echo ":white_check_mark: This version is recommended for production servers." >> changelog.md
fi
echo -e "\n\n\n" >> changelog.md
echo ":information_source: **Linux/MacOS users**: Please see [this page](https://doc.pmmp.io/en/rtfd/faq/installation/opcache.so.html) to fix extension loading errors. Also, check out the [PocketMine-MP Linux/MacOS installer](https://doc.pmmp.io/en/rtfd/installation/get-dot-pmmp-dot-io.html)." >> changelog.md
- name: Update latest branch release
uses: ncipollo/release-action@v1.13.0
with:
artifacts: |
${{ github.workspace }}/Linux-PM*/*.tar.gz
${{ github.workspace }}/MacOS-PM*/*.tar.gz
${{ github.workspace }}/Windows-PM*/*.zip
${{ github.workspace }}/Linux-PM4/Linux.zip
${{ github.workspace }}/MacOS-PM4/PHP-*.tar.gz
${{ github.workspace }}/Windows-PM4/PHP-*.zip
makeLatest: ${{ github.ref_name == github.event.repository.default_branch }}
name: PHP ${{ steps.version.outputs.PHP_VERSION }} - Latest (Build ${{ github.run_number }})
tag: php-${{ steps.version.outputs.PHP_VERSION }}-latest
name: PHP ${{ steps.version.outputs.PHP_VERSION }} for PM4
tag: ${{ steps.version.outputs.PHP_VERSION }}
commit: ${{ github.sha }}
allowUpdates: true
bodyFile: ${{ github.workspace }}/changelog.md
removeArtifacts: true
prerelease: ${{ endsWith(github.ref_name, '-preview') }}

- name: Publish unique release
- name: Update latest branch release
uses: ncipollo/release-action@v1.13.0
with:
artifacts: |
${{ github.workspace }}/Linux-PM*/*.tar.gz
${{ github.workspace }}/MacOS-PM*/*.tar.gz
${{ github.workspace }}/Windows-PM*/*.zip
makeLatest: false
name: PHP ${{ steps.version.outputs.PHP_VERSION }} (Build ${{ github.run_number }})
tag: php-${{ steps.version.outputs.PHP_VERSION }}-build-${{ github.run_number }}
${{ github.workspace }}/Linux-PM5/Linux.zip
${{ github.workspace }}/MacOS-PM5/PHP-*.tar.gz
${{ github.workspace }}/Windows-PM5/PHP-*.zip
makeLatest: ${{ github.ref_name == github.event.repository.default_branch }}
name: PHP ${{ steps.version.outputs.PHP_VERSION }} for PM5
tag: ${{ steps.version.outputs.PHP_VERSION }}-pm5
commit: ${{ github.sha }}
bodyFile: ${{ github.workspace }}/changelog.md
prerelease: ${{ endsWith(github.ref_name, '-preview') }}

allowUpdates: true
removeArtifacts: true
prerelease: ${{ endsWith(github.ref_name, '-preview') }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
bin/
bin-debug/
install_data/
download_cache/
test.dSYM/
install.log
temp_data/
compile.log
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Bash script used to compile PHP on MacOS and Linux platforms. Make sure you have
| -d | Compiles with debugging symbols and disables optimizations (slow, but useful for debugging segfaults) |
| -D | Compiles with separated debugging symbols, but leaves optimizations enabled (used for distributed binaries) |
| -g | Will compile GD2 |
| -F | Will compile FFI |
| -j | Set make threads to # |
| -l | Uses the folder specified for caching compilation artifacts (useful for rapid rebuild and testing) |
| -n | Don't remove sources after completing compilation |
Expand Down
Loading

0 comments on commit de67077

Please sign in to comment.