Skip to content

Fixed #11

Fixed #11 #22

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: "Presence-Man-PocketMine-MP-v${{ steps.metadata.outputs.VERSION }}.phar"
- 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"