Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Build Zuri.phar and Draft a release to github! #2

Build Zuri.phar and Draft a release to github!

Build Zuri.phar and Draft a release to github! #2

Workflow file for this run

name: Release Plugin
run-name: Build Zuri.phar and Draft a release to github!
on:
push:
workflow_dispatch:
jobs:
build-phar:
runs-on: ubuntu-latest
if: contains(github.event.head_commit.message, 'Release')
steps:
- name: Checkout the repository.
uses: actions/checkout@v4
- name: Download php-binaries.
run: "curl -sL https://github.com/pmmp/PHP-Binaries/releases/latest/download/PHP-Linux-x86_64-PM5.tar.gz -o php.tar.gz"
- name: Extract php-binaries.
run: "tar -xvzf php.tar.gz"
- name: chmod the php-binaries.
run: "chmod +x ./bin/php7/bin/php"
- name: Fix opcache.so
run: EXTENSION_DIR=$(find "$(pwd)/bin" -name "*debug-zts*") \
grep -q '^extension_dir' bin/php7/bin/php.ini && sed -i'bak' "s{^extension_dir=.*{extension_dir=\"$EXTENSION_DIR\"{" bin/php7/bin/php.ini || echo "extension_dir=\"$EXTENSION_DIR\"" >> bin/php7/bin/php.ini
- name: Install php-cs-fixer.
run: "curl -sL https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/latest/download/php-cs-fixer.phar -o php-cs-fixer.phar"
- name: Run php-cs-fixer.
run: "./bin/php7/bin/php php-cs-fixer.phar fix src"
- name: Run build.php
run: "./bin/php7/bin/php -dphar.readonly=0 tools/build.php"
- uses: ChanTsune/release-with-commit@v3.0.0
id: create_release
continue-on-error: true
with:
regexp: "Release (\\d+([.]\\d+)*)\n*((\\s|\\S)+)"
regexp_options: "us"
release_name: "Zuri Anticheat: v$1"
tag_name: "v$1"
body: "$3"
draft: true
prerelease: false
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- name: Upload Release Asset
id: upload-release-asset
continue-on-error: true
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./ZuriLite.phar
asset_name: ZuriLite.phar
asset_content_type: application/zip
- name: Codespace Cleanup
run: "rm -rf *"