Skip to content

Workflow file for this run

name: "Stable release"
on:
push:
branches: [ "main" ]
files: [ "src/**" ]
jobs:
release:
name: "Create stable release"
if: "!contains(github.event.head_commit.message, 'ci ignore')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Setup PHP 8.0
uses: shivammathur/[email protected]
with:
php-version: 8.0
tools: composer
extensions: yaml pthreads sockets mysqli zlib
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Composer
run: |
composer update --no-interaction --ignore-platform-reqs
composer install --no-suggest --no-interaction --ignore-platform-reqs
- name: "Get data"
id: metadata
run: |
echo "VERSION=$(php -r 'echo explode("+", explode("-", yaml_parse_file(getcwd() . DIRECTORY_SEPARATOR . "plugin.yml")["version"])[0])[0];')" >> $GITHUB_OUTPUT
echo "FULL_VERSION=$(php -r 'echo yaml_parse_file(getcwd() . DIRECTORY_SEPARATOR . "plugin.yml")["version"];')" >> $GITHUB_OUTPUT
echo "NAME=$(php -r 'echo yaml_parse_file(getcwd() . DIRECTORY_SEPARATOR . "plugin.yml")["name"];')" >> $GITHUB_OUTPUT
- name: "Build phar"
run: "php -dphar.readonly=0 build.php"
- name: "Rename PHAR"
run: |
cp ${{ steps.metadata.outputs.NAME }}.phar Presence-Man-PocketMine-MP-v${{ steps.metadata.outputs.VERSION }}.phar
cp ${{ steps.metadata.outputs.NAME }}.phar Presence-Man-PocketMine-MP.phar
- name: "Create Release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v${{ steps.metadata.outputs.VERSION }}"
prerelease: false
title: "Stable release v${{ steps.metadata.outputs.VERSION }}"
files: "*.phar"
#- name: "Create version-pocketmine-mp.txt"
# run: "echo \"${{ steps.metadata.outputs.VERSION }}\" >> version-pocketmine-mp.txt"
#- name: "Pushes latest version-pocketmine-mp.txt file"
# uses: dmnemec/copy_file_to_another_repo_action@main
# env:
# API_TOKEN_GITHUB: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
# with:
# source_file: 'version-pocketmine-mp.txt'
# destination_repo: 'Presence-Man/releases'
# destination_folder: ''
# user_email: '[email protected]'
# user_name: 'xxAROX'
# commit_message: 'Updated "PocketMine-PM Client" version'
#- name: "Release to public"
# uses: softprops/action-gh-release@v1
# with:
# tag_name: "latest"
# name: "Latest releases"
# repository: "Presence-Man/releases"
# token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
# files: "Presence-Man-PocketMine-MP.phar"