-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'minor-next' into master
- Loading branch information
Showing
56 changed files
with
2,114 additions
and
1,538 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,85 @@ | ||
name: Draft release | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
draft-url: | ||
description: 'The URL of the draft release' | ||
value: ${{ jobs.draft.outputs.draft-url }} | ||
version: | ||
description: 'PocketMine-MP version' | ||
value: ${{ jobs.draft.outputs.version }} | ||
#presume that pull_request_target is safe at this point, since the PR was approved and merged | ||
#we need write access to prepare the release & create comments | ||
pull_request_target: | ||
types: | ||
- closed | ||
branches: | ||
- stable | ||
- minor-next | ||
- major-next | ||
- "legacy/*" | ||
paths: | ||
- "src/VersionInfo.php" | ||
push: | ||
tags: | ||
- "*" | ||
|
||
env: | ||
PHP_VERSION: "8.2" | ||
|
||
jobs: | ||
skip: | ||
name: Check whether to ignore this tag | ||
runs-on: ubuntu-20.04 | ||
|
||
outputs: | ||
skip: ${{ steps.exists.outputs.exists == 'true' }} | ||
|
||
steps: | ||
- name: Check if release already exists | ||
id: exists | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
exists=false | ||
if [[ "${{ github.ref_type }}" == "tag" ]]; then | ||
tag="$(echo "${{ github.ref }}" | cut -d/ -f3-)" | ||
if gh release view "$tag" --repo "${{ github.repository }}"; then | ||
exists=true | ||
fi | ||
fi | ||
echo exists=$exists >> $GITHUB_OUTPUT | ||
check: | ||
needs: [skip] | ||
if: needs.skip.outputs.skip != 'true' | ||
name: Check release | ||
uses: ./.github/workflows/draft-release-pr-check.yml | ||
|
||
trigger-post-release-workflow: | ||
name: Trigger post-release RestrictedActions workflow | ||
needs: [check] | ||
if: needs.check.outputs.valid == 'true' && github.ref_type != 'tag' #can't do post-commit for a tag | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Generate access token | ||
id: generate-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.RESTRICTED_ACTIONS_DISPATCH_ID }} | ||
private-key: ${{ secrets.RESTRICTED_ACTIONS_DISPATCH_KEY }} | ||
owner: ${{ github.repository_owner }} | ||
repositories: RestrictedActions | ||
|
||
- name: Dispatch post-release restricted action | ||
uses: peter-evans/repository-dispatch@v3 | ||
with: | ||
token: ${{ steps.generate-token.outputs.token }} | ||
repository: ${{ github.repository_owner }}/RestrictedActions | ||
event-type: pocketmine_mp_post_release | ||
client-payload: '{"branch": "${{ github.ref }}"}' | ||
|
||
draft: | ||
name: Create GitHub draft release | ||
needs: [check] | ||
if: needs.check.outputs.valid == 'true' || github.ref_type == 'tag' #ignore validity check for tags | ||
|
||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: [8.2] | ||
|
||
outputs: | ||
draft-url: ${{ steps.create-draft.outputs.html_url }} | ||
version: ${{ steps.get-pm-version.outputs.PM_VERSION }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -32,7 +89,7 @@ jobs: | |
- name: Setup PHP | ||
uses: shivammathur/[email protected] | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
php-version: ${{ env.PHP_VERSION }} | ||
|
||
- name: Restore Composer package cache | ||
uses: actions/cache@v4 | ||
|
@@ -50,7 +107,7 @@ jobs: | |
- name: Calculate build number | ||
id: build-number | ||
run: | | ||
BUILD_NUMBER=$((2000+$GITHUB_RUN_NUMBER)) #to stay above jenkins | ||
BUILD_NUMBER=$((2300+$GITHUB_RUN_NUMBER)) #to stay above jenkins | ||
echo "Build number: $BUILD_NUMBER" | ||
echo BUILD_NUMBER=$BUILD_NUMBER >> $GITHUB_OUTPUT | ||
|
@@ -63,23 +120,31 @@ jobs: | |
- name: Get PocketMine-MP release version | ||
id: get-pm-version | ||
run: | | ||
echo PM_VERSION=$(php build/dump-version-info.php base_version) >> $GITHUB_OUTPUT | ||
PM_VERSION=$(php build/dump-version-info.php base_version) | ||
echo PM_VERSION=$PM_VERSION >> $GITHUB_OUTPUT | ||
echo PM_MAJOR=$(php build/dump-version-info.php major_version) >> $GITHUB_OUTPUT | ||
echo MCPE_VERSION=$(php build/dump-version-info.php mcpe_version) >> $GITHUB_OUTPUT | ||
echo CHANGELOG_FILE_NAME=$(php build/dump-version-info.php changelog_file_name) >> $GITHUB_OUTPUT | ||
echo CHANGELOG_MD_HEADER=$(php build/dump-version-info.php changelog_md_header) >> $GITHUB_OUTPUT | ||
echo PRERELEASE=$(php build/dump-version-info.php prerelease) >> $GITHUB_OUTPUT | ||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then | ||
tag="$(echo "${{ github.ref }}" | cut -d/ -f3-)" | ||
else | ||
tag="$PM_VERSION" | ||
fi | ||
echo TAG_NAME=$tag >> $GITHUB_OUTPUT | ||
- name: Generate PHP binary download URL | ||
id: php-binary-url | ||
run: | | ||
echo PHP_BINARY_URL="${{ github.server_url }}/${{ github.repository_owner }}/PHP-Binaries/releases/tag/pm${{ steps.get-pm-version.outputs.PM_MAJOR }}-php-${{ matrix.php-version }}-latest" >> $GITHUB_OUTPUT | ||
echo PHP_BINARY_URL="${{ github.server_url }}/${{ github.repository_owner }}/PHP-Binaries/releases/tag/pm${{ steps.get-pm-version.outputs.PM_MAJOR }}-php-${{ env.PHP_VERSION }}-latest" >> $GITHUB_OUTPUT | ||
- name: Generate build info | ||
run: | | ||
php build/generate-build-info-json.php \ | ||
${{ github.sha }} \ | ||
${{ steps.get-pm-version.outputs.PM_VERSION }} \ | ||
${{ steps.get-pm-version.outputs.TAG_NAME }} \ | ||
${{ github.repository }} \ | ||
${{ steps.build-number.outputs.BUILD_NUMBER }} \ | ||
${{ github.run_id }} \ | ||
|
@@ -108,12 +173,17 @@ jobs: | |
draft: true | ||
prerelease: ${{ steps.get-pm-version.outputs.PRERELEASE }} | ||
name: PocketMine-MP ${{ steps.get-pm-version.outputs.PM_VERSION }} | ||
tag: ${{ steps.get-pm-version.outputs.PM_VERSION }} | ||
tag: ${{ steps.get-pm-version.outputs.TAG_NAME }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
skipIfReleaseExists: true #for release PRs, tags will be created on release publish and trigger the tag release workflow - don't create a second draft | ||
body: | | ||
**For Minecraft: Bedrock Edition ${{ steps.get-pm-version.outputs.MCPE_VERSION }}** | ||
Please see the [changelogs](${{ github.server_url }}/${{ github.repository }}/blob/${{ steps.get-pm-version.outputs.PM_VERSION }}/changelogs/${{ steps.get-pm-version.outputs.CHANGELOG_FILE_NAME }}#${{ steps.get-pm-version.outputs.CHANGELOG_MD_HEADER }}) for details. | ||
:information_source: Download the recommended PHP binary [here](${{ steps.php-binary-url.outputs.PHP_BINARY_URL }}). | ||
- name: Post draft release URL on PR | ||
if: github.event_name == 'pull_request_target' | ||
uses: thollander/actions-comment-pull-request@v3 | ||
with: | ||
message: "[Draft release ${{ steps.get-pm-version.outputs.PM_VERSION }}](${{ steps.create-draft.outputs.html_url }}) has been created for commit ${{ github.sha }}. Please review and publish it." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: 'Clean up stale PRs' | ||
on: | ||
schedule: | ||
- cron: '30 1 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v9 | ||
with: | ||
days-before-issue-stale: -1 | ||
days-before-issue-close: -1 | ||
stale-pr-message: | | ||
This PR has been marked as "Waiting on Author", but we haven't seen any activity in 7 days. | ||
If there is no further activity, it will be closed in 28 days. | ||
Note for maintainers: Adding an assignee to the PR will prevent it from being marked as stale. | ||
close-pr-message: | | ||
As this PR hasn't been updated for a while, unfortunately we'll have to close it. | ||
days-before-pr-stale: 7 | ||
days-before-pr-close: 28 | ||
only-labels: "Status: Waiting on Author" | ||
close-pr-label: "Resolution: Abandoned" | ||
exempt-all-assignees: true | ||
|
Oops, something went wrong.