ci: replace Paper GitHub workflows with Gitea-native build workflow (split applyPatches/build)
Build Delta / Build paperclip jar (push) Failing after 1m12s
Build Delta / Build paperclip jar (push) Failing after 1m12s
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
name: Build Delta
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
JAVA_VERSION: "21"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build paperclip jar
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker.io/library/eclipse-temurin:21-jdk
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: false
|
||||
|
||||
- name: Setup gradle cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
.gradle
|
||||
key: delta-gradle-${{ github.ref_name }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
delta-gradle-${{ github.ref_name }}-
|
||||
|
||||
# applyPatches and createMojmapPaperclipJar MUST be separate invocations:
|
||||
# combined they fail with an implicit-dependency error on
|
||||
# applyResourcePatches -> processResources.
|
||||
- name: Apply patches
|
||||
run: ./gradlew applyPatches --stacktrace
|
||||
|
||||
- name: Build paperclip jar
|
||||
run: ./gradlew createMojmapPaperclipJar --stacktrace
|
||||
|
||||
- name: List artifacts
|
||||
run: ls -la paper-server/build/libs/
|
||||
|
||||
- name: Upload jar
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: delta-paperclip
|
||||
path: |
|
||||
paper-server/build/libs/paper-paperclip-*.jar
|
||||
paper-server/build/libs/paper-server-*.jar
|
||||
retention-days: 14
|
||||
if-no-files-found: error
|
||||
@@ -1,143 +0,0 @@
|
||||
# Here lie dragons!
|
||||
#
|
||||
# This action either builds the server or
|
||||
# builds a paperclip jar to be updated in the body
|
||||
# of the PR relating to this action.
|
||||
|
||||
name: Build Paper
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronize
|
||||
- labeled
|
||||
|
||||
jobs:
|
||||
build:
|
||||
env:
|
||||
ORG_GRADLE_PROJECT_paperBuildCacheEnabled: true
|
||||
ORG_GRADLE_PROJECT_paperBuildCacheUsername: ${{ secrets.PAPER_BUILD_CACHE_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_paperBuildCachePassword: ${{ secrets.PAPER_BUILD_CACHE_PASSWORD }}
|
||||
ORG_GRADLE_PROJECT_paperBuildCachePush: true
|
||||
|
||||
# The goal of the build workflow is split into multiple requirements.
|
||||
# 1. Run on pushes to same repo.
|
||||
# 2. Run on PR open/reopen/syncs from repos that are not the same (PRs from the same repo are covered by 1)
|
||||
# 3. Run on labeled PRs that have the publish-pr flag.
|
||||
if: >
|
||||
(
|
||||
(github.event_name == 'push')
|
||||
|| (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name && contains(fromJSON('["opened", "reopened", "synchronize"]'), github.event.action))
|
||||
|| (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'publish-pr')
|
||||
)
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
steps:
|
||||
- if: ${{ github.event_name == 'push' }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# todo remove me again after the update
|
||||
ref: ${{ github.ref_name }}
|
||||
fetch-depth: 0
|
||||
- if: ${{ github.event_name == 'pull_request' }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: 21
|
||||
distribution: 'zulu'
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
# Allow cache writes on main and dev branches
|
||||
cache-read-only: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/dev/') }}
|
||||
|
||||
- name: Configure Build
|
||||
uses: actions/github-script@v7
|
||||
id: determine
|
||||
env:
|
||||
REF_NAME: "${{ github.ref_name }}"
|
||||
REF_TYPE: "${{ github.ref_type }}"
|
||||
EVENT: "${{ toJSON(github.event) }}"
|
||||
EVENT_TYPE: "${{ github.event_name }}"
|
||||
with:
|
||||
script: |
|
||||
const {owner, repo} = context.repo;
|
||||
const event_name = `${process.env.EVENT_TYPE}`;
|
||||
const event = JSON.parse(`${process.env.EVENT}`);
|
||||
const ref_type = `${process.env.REF_TYPE}`;
|
||||
const ref_name = `${process.env.REF_NAME}`;
|
||||
const result = {
|
||||
action: "build"
|
||||
};
|
||||
|
||||
if (event_name === "push" && ref_type === "branch") {
|
||||
const {data: pulls} = await github.rest.pulls.list({ owner, repo, head: `${owner}:${ref_name}`, state: "open" });
|
||||
const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "publish-pr"));
|
||||
if (pull) {
|
||||
result["pr"] = pull.number;
|
||||
result["action"] = "paperclip";
|
||||
core.notice(`This is a push action but to a branch with an open PR with the build paperclip label (${JSON.stringify(result)})`);
|
||||
return result;
|
||||
}
|
||||
} else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "publish-pr")) {
|
||||
result["pr"] = event.pull_request.number;
|
||||
result["action"] = "paperclip";
|
||||
core.notice(`This is a pull request action with a build paperclip label (${JSON.stringify(result)})`);
|
||||
return result;
|
||||
}
|
||||
core.notice("This will not build a paperclip jar");
|
||||
return result;
|
||||
|
||||
- name: Apply Patches
|
||||
run: |
|
||||
git config --global user.email "no-reply@github.com"
|
||||
git config --global user.name "GitHub Actions"
|
||||
./gradlew applyPatches --stacktrace
|
||||
|
||||
- name: Build
|
||||
run: ./gradlew build --stacktrace
|
||||
|
||||
- name: Upload Test Results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Test Results
|
||||
path: |
|
||||
**/build/test-results/test/TEST-*.xml
|
||||
|
||||
- name: Create Paperclip Jar
|
||||
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
|
||||
run: ./gradlew createMojmapPaperclipJar --stacktrace
|
||||
|
||||
- name: Upload Paperclip Jar
|
||||
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: paper-${{ fromJSON(steps.determine.outputs.result).pr }}
|
||||
path: paper-server/build/libs/paper-paperclip-*-mojmap.jar
|
||||
|
||||
- name: Publish Artifacts
|
||||
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
|
||||
uses: PaperMC/action-pr-publishing/upload@paper
|
||||
with:
|
||||
# TODO fallback for failing javadoc
|
||||
publishing-task: ":paper-api:publishAllPublicationsTo_githubPackages_PRsRepository publishDevBundlePublicationTo_githubPackages_PRsRepository -PpublishDevBundle"
|
||||
event_file:
|
||||
name: "Event File"
|
||||
# Only run on PRs if the source branch is on someone else's repo
|
||||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Event File
|
||||
path: ${{ github.event_path }}
|
||||
@@ -1,27 +0,0 @@
|
||||
name: Close invalid PRs
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [ opened ]
|
||||
|
||||
jobs:
|
||||
run:
|
||||
if: |
|
||||
github.repository != github.event.pull_request.head.repo.full_name &&
|
||||
(
|
||||
github.head_ref == 'main' ||
|
||||
github.event.pull_request.head.repo.owner.type != 'User'
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
id: "main_branch"
|
||||
if: github.head_ref == 'main'
|
||||
with:
|
||||
comment: "Please do not open pull requests from the `main` branch, create a new branch instead."
|
||||
|
||||
- uses: superbrothers/close-pull-request@v3
|
||||
id: "org_account"
|
||||
if: github.event.pull_request.head.repo.owner.type != 'User' && steps.main_branch.outcome == 'skipped'
|
||||
with:
|
||||
comment: "Please do not open pull requests from non-user accounts like organizations. Create a fork on a user account instead."
|
||||
@@ -1,77 +0,0 @@
|
||||
name: Update Projects
|
||||
|
||||
on:
|
||||
issues:
|
||||
types:
|
||||
- labeled
|
||||
- unlabeled
|
||||
- closed
|
||||
- reopened
|
||||
|
||||
jobs:
|
||||
bugs:
|
||||
if: "github.event_name == 'issues' && contains(github.event.*.labels.*.name, 'type: bug')"
|
||||
concurrency:
|
||||
group: update-bugs-project-${{ github.event.issue.number }}
|
||||
cancel-in-progress: true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "authenticate"
|
||||
id: "authenticate"
|
||||
uses: "tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a" # v2.1.0
|
||||
with:
|
||||
installation_retrieval_mode: id
|
||||
installation_retrieval_payload: "36153445"
|
||||
app_id: "${{ secrets.PROJECTS_APP_ID }}"
|
||||
private_key: "${{ secrets.PROJECTS_PRIVATE_KEY }}"
|
||||
|
||||
- uses: PaperMC/update-projects-action@v0.2.0
|
||||
name: Update open issue
|
||||
if: github.event.issue.state == 'open'
|
||||
with:
|
||||
github-token: "${{ steps.authenticate.outputs.token }}"
|
||||
project-url: https://github.com/orgs/PaperMC/projects/5/views/2
|
||||
column-field: Status
|
||||
label-to-column-map: |
|
||||
{
|
||||
"resolution: awaiting response": "⌛ Awaiting Response",
|
||||
"resolution: cannot reproduce": "Invalid",
|
||||
"resolution: duplicate": "Invalid",
|
||||
"resolution: incomplete": "Invalid",
|
||||
"resolution: invalid": "Invalid",
|
||||
"resolution: superseded": "Invalid",
|
||||
"resolution: unsupported": "Invalid",
|
||||
"resolution: won't fix": "Invalid",
|
||||
"resolution: works as intended": "Invalid",
|
||||
"status: accepted": "✅ Accepted",
|
||||
"status: blocked": "Needs Work",
|
||||
"status: defer upstream": "Needs Work",
|
||||
"status: in progress": "Needs Work",
|
||||
"status: input wanted": "Needs Work",
|
||||
"status: needs triage": "🕑 Needs Triage",
|
||||
"status: rebase required": "Needs Work",
|
||||
"status: unlikely": "✅ Accepted"
|
||||
}
|
||||
|
||||
- uses: PaperMC/update-projects-action@v0.2.0
|
||||
name: Update closed issue
|
||||
if: github.event.issue.state == 'closed'
|
||||
with:
|
||||
github-token: "${{ steps.authenticate.outputs.token }}"
|
||||
project-url: https://github.com/orgs/PaperMC/projects/5/views/2
|
||||
column-field: Status
|
||||
clear-on-no-match: false
|
||||
# include "status: needs triage" below to catch any closed issues without setting a resolution
|
||||
label-to-column-map: |
|
||||
{
|
||||
"resolution: cannot reproduce": "Invalid",
|
||||
"resolution: duplicate": "Invalid",
|
||||
"resolution: incomplete": "Invalid",
|
||||
"resolution: invalid": "Invalid",
|
||||
"resolution: superseded": "Invalid",
|
||||
"resolution: unsupported": "Invalid",
|
||||
"resolution: won't fix": "Invalid",
|
||||
"resolution: works as intended": "Invalid",
|
||||
"status: accepted": "Done",
|
||||
"status: needs triage": "Invalid"
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
name: Publish PR
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [ "Build Paper" ]
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions:
|
||||
packages: write # To upload the PR
|
||||
actions: write # To get information about the uploading workflow run and to delete the run artifacts
|
||||
contents: write # To download the `maven-publish` artifact, and to be able to create commit comments
|
||||
issues: write # To be able to create PR comments
|
||||
pull-requests: write # To be able to create PR comments
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate an Application repository access token
|
||||
id: gen_repo_token
|
||||
uses: kattecon/gh-app-access-token-gen@v1
|
||||
with:
|
||||
app_id: 1408328
|
||||
private_key: ${{ secrets.PR_PUBLISHING_GH_APP_KEY }}
|
||||
repository: ${{ github.repository }}
|
||||
- name: Publish PR
|
||||
uses: PaperMC/action-pr-publishing@paper
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.gen_repo_token.outputs.token }}
|
||||
with:
|
||||
publishing-token: ${{ github.token }}
|
||||
uploader-workflow-name: Build Paper
|
||||
artifacts-base-path: io/papermc/paper
|
||||
base-maven-url: 'https://maven-prs.papermc.io'
|
||||
self-name: 'papermc-pr-publishing[bot]'
|
||||
@@ -1,34 +0,0 @@
|
||||
name: Test Results
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [ "Build Paper" ]
|
||||
types:
|
||||
- completed
|
||||
permissions: { }
|
||||
|
||||
jobs:
|
||||
test-results:
|
||||
name: Test Results
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.workflow_run.conclusion != 'skipped'
|
||||
permissions:
|
||||
checks: write
|
||||
# for downloading test result artifacts
|
||||
actions: read
|
||||
steps:
|
||||
- name: Download and Extract Artifacts
|
||||
uses: dawidd6/action-download-artifact@v6
|
||||
with:
|
||||
run_id: ${{ github.event.workflow_run.id }}
|
||||
path: test_artifacts
|
||||
name: "Test Results|Event File"
|
||||
name_is_regexp: true
|
||||
- name: Publish Test Results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v2
|
||||
with:
|
||||
commit: ${{ github.event.workflow_run.head_sha }}
|
||||
event_file: test_artifacts/Event File/event.json
|
||||
event_name: ${{ github.event.workflow_run.event }}
|
||||
files: "test_artifacts/**/*.xml"
|
||||
comment_mode: off
|
||||
Reference in New Issue
Block a user