Skip to content

Commit

Permalink
Improve release process
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jan 8, 2024
1 parent 01ebca7 commit b9f56cc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ on:
description: 'PocketMine-MP major version'
required: true
type: number
latest:
description: 'Whether to make this the latest release'
required: true
type: boolean
recommend:
description: 'Recommended PHP version for this PM version'
required: true
type: string

jobs:
linux:
Expand Down Expand Up @@ -185,8 +193,9 @@ jobs:
run: |
echo "Last updated on **$(date -u +'%Y-%m-%d at %H:%M:%S %Z')**" > changelog.md
echo -e "\n\n" >> changelog.md
echo "Build number: ${{ github.run_number }}" >> 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
if [[ "${{ steps.version.outputs.PHP_VERSION }}" != "${{ inputs.recommend }}" ]]; then
echo -e "\n\n\n" >> changelog.md
if [[ "${{ github.ref_name }}" == *"preview" ]]; then
echo "# :warning: :radioactive: EXPERIMENTAL!!! :radioactive: :warning:" >> changelog.md
Expand All @@ -198,38 +207,20 @@ jobs:
echo "If you have problems, try the [recommended release for PM${{ inputs.pm-version-major }}](${{ github.server_url }}/${{ github.repository }}/releases/php-pm${{ inputs.pm-version-major }}-latest) instead." >> changelog.md
fi
else
echo ":white_check_mark: Recommended for production servers running **PocketMine-MP ${{ inputs.pm-version-major }}.x**." >> changelog.md
echo ":white_check_mark: Recommended for **PocketMine-MP ${{ inputs.pm-version-major }}.x**." >> 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 PM major-version release
#TODO: we may not want to recommend the same PHP version for all PM major versions
#in the future we should probably introduce configuration for this
if: ${{ github.ref_name == github.event.repository.default_branch }}
uses: ncipollo/[email protected]
with:
artifacts: |
${{ github.workspace }}/Linux-PM${{ inputs.pm-version-major }}/*.tar.gz
${{ github.workspace }}/MacOS-PM${{ inputs.pm-version-major }}/*.tar.gz
${{ github.workspace }}/Windows-PM${{ inputs.pm-version-major }}/*.zip
makeLatest: ${{ github.ref_name == github.event.repository.default_branch }}
name: PHP for PocketMine-MP ${{ inputs.pm-version.major }}.x - Latest (Build ${{ github.run_number }})
tag: php-pm${{ inputs.pm-version-major }}-latest
commit: ${{ github.sha }}
allowUpdates: true
bodyFile: ${{ github.workspace }}/changelog.md
removeArtifacts: true

- name: Update latest branch release
uses: ncipollo/[email protected]
with:
artifacts: |
${{ github.workspace }}/Linux-PM${{ inputs.pm-version-major }}/*.tar.gz
${{ github.workspace }}/MacOS-PM${{ inputs.pm-version-major }}/*.tar.gz
${{ github.workspace }}/Windows-PM${{ inputs.pm-version-major }}/*.zip
makeLatest: ${{ github.ref_name == github.event.repository.default_branch }}
name: PHP ${{ steps.version.outputs.PHP_VERSION }} for PocketMine-MP ${{ inputs.pm-version.major }}.x - Latest (Build ${{ github.run_number }})
makeLatest: ${{ inputs.latest }}
name: PHP ${{ steps.version.outputs.PHP_VERSION }} for PocketMine-MP ${{ inputs.pm-version-major }}.x - Latest
tag: php-${{ steps.version.outputs.PHP_VERSION }}-pm${{ inputs.pm-version-major }}-latest
commit: ${{ github.sha }}
allowUpdates: true
Expand All @@ -245,7 +236,7 @@ jobs:
${{ github.workspace }}/MacOS-PM${{ inputs.pm-version-major }}/*.tar.gz
${{ github.workspace }}/Windows-PM${{ inputs.pm-version-major }}/*.zip
makeLatest: false
name: PHP ${{ steps.version.outputs.PHP_VERSION }} for PocketMine-MP ${{ inputs.pm-version.major }}.x - (Build ${{ github.run_number }})
name: PHP ${{ steps.version.outputs.PHP_VERSION }} for PocketMine-MP ${{ inputs.pm-version-major }}.x - (Build ${{ github.run_number }})
tag: php-${{ steps.version.outputs.PHP_VERSION }}-pm${{ inputs.pm-version-major }}-build-${{ github.run_number }}
commit: ${{ github.sha }}
bodyFile: ${{ github.workspace }}/changelog.md
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ jobs:
name: PM${{ matrix.pm-version-major }}
strategy:
matrix:
pm-version-major: [4, 5]
include:
- pm-version-major: 4
latest: false
recommend: '8.1'
- pm-version-major: 5
latest: ${{ github.ref_name == github.event.repository.default_branch }}
recommend: '8.2'
uses: ./.github/workflows/build.yml
with:
pm-version-major: ${{ matrix.pm-version-major }}
Expand Down

0 comments on commit b9f56cc

Please sign in to comment.