Skip to content

Commit

Permalink
Initial work on 1.20.4 port
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Apr 4, 2024
1 parent 7d7f84e commit 15eda79
Show file tree
Hide file tree
Showing 51 changed files with 3,217 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_size = 4
trim_trailing_whitespace = true
indent_style = space

[*.{json,json5,mcmeta}]
indent_size = 2

[*.bat]
end_of_line = crlf
28 changes: 28 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
*.java text eol=lf diff=java
*.gradle text eol=lf diff=java
gradlew text eol=lf
*.bat text eol=crlf

*.md text eol=lf diff=markdown

.editorconfig text eol=lf

*.json text eol=lf
*.json5 text eol=lf
*.properties text eol=lf
*.toml text eol=lf
*.xml text eol=lf diff=html

# Modding specific
*.accesswidener text eol=lf

# These files are binary and should be left untouched
# (binary is a macro for -text -diff)
*.class binary
*.dll binary
*.ear binary
*.jar binary
*.jks binary
*.png binary
*.so binary
*.war binary
69 changes: 69 additions & 0 deletions .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"jobs": {
"build": {
"runs-on": "ubuntu-22.04",
"steps": [
{
"name": "Setup Java",
"run": "echo \"JAVA_HOME=$JAVA_HOME_17_X64\" >> \"$GITHUB_ENV\""
},
{
"with": {
"fetch-depth": "0",
"persist-credentials": "false"
},
"name": "Checkout",
"uses": "actions/checkout@v4"
},
{
"with": {
"path": "**/.gradle/loom-cache",
"key": "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}",
"restore-keys": "${{ runner.os }}-gradle-"
},
"name": "Cache",
"uses": "actions/cache/restore@v4"
},
{
"with": {
"cache-read-only": true,
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/gradle-build-action@v3"
},
{
"name": "Build",
"run": "./gradlew build",
"id": "build",
"env": {
"PR_NUMBER": "${{ github.event.pull_request.number }}"
}
},
{
"name": "Publish",
"run": "./gradlew publish",
"id": "publish",
"env": {
"PR_NUMBER": "${{ github.event.pull_request.number }}"
}
},
{
"with": {
"name": "artifacts",
"path": "build/repo"
},
"name": "Archive Publishable Artifacts",
"uses": "actions/upload-artifact@v4"
}
]
}
},
"name": "Build PR",
"concurrency": "ci-${{ github.ref }}",
"on": {
"pull_request": {

}
}
}
56 changes: 56 additions & 0 deletions .github/workflows/publish_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"jobs": {
"publish": {
"runs-on": "ubuntu-22.04",
"steps": [
{
"with": {
"repository": "lukebemish/artifact-sync",
"ref": "refs/heads/main",
"persist-credentials": false
},
"name": "Checkout Artifact Sync",
"uses": "actions/checkout@v4"
},
{
"run": "mkdir repo"
},
{
"with": {
"script": "const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};\nif (!pull_requests.length) {\n return core.error(\"This workflow doesn't match any pull requests!\");\n}\nlet allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({\n owner: context.repo.owner,\n repo: context.repo.repo,\n run_id: context.payload.workflow_run.id,\n});\nlet matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {\n return artifact.name == \"artifacts\"\n})[0];\nlet download = await github.rest.actions.downloadArtifact({\n owner: context.repo.owner,\n repo: context.repo.repo,\n artifact_id: matchArtifact.id,\n archive_format: 'zip',\n});\nlet fs = require('fs');\nfs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/repo.zip`, Buffer.from(download.data));"
},
"name": "Download Artifacts",
"uses": "actions/github-script@v7"
},
{
"name": "Unpack Artifacts",
"run": "unzip repo.zip -d repo"
},
{
"name": "Publish Artifacts",
"run": "python3 run.py",
"env": {
"MAVEN_USER": "github",
"MAVEN_PASSWORD": "${{ secrets.PR_MAVEN_PASSWORD }}",
"MAVEN_URL": "https://maven.lukebemish.dev/pullrequests/",
"ALLOWED_VERSION": "*-pr${{ github.event.workflow_run.pull_requests[0].number }}",
"ALLOWED_PATHS": "dev/lukebemish/dynamicassetgenerator/dynamicassetgenerator-*"
}
}
],
"if": "${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}"
}
},
"name": "Publish PR",
"concurrency": "ci-${{ github.ref }}",
"on": {
"workflow_run": {
"workflows": [
"Build PR"
],
"types": [
"completed"
]
}
}
}
142 changes: 142 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"jobs": {
"build": {
"outputs": {
"version": "${{ steps.record_version_capture_version.outputs.version }}"
},
"runs-on": "ubuntu-22.04",
"permissions": {
"contents": "write"
},
"steps": [
{
"name": "Setup Java",
"run": "echo \"JAVA_HOME=$JAVA_HOME_17_X64\" >> \"$GITHUB_ENV\""
},
{
"with": {
"fetch-depth": "0"
},
"name": "Checkout",
"uses": "actions/checkout@v4"
},
{
"with": {
"path": "**/.gradle/loom-cache",
"key": "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}",
"restore-keys": "${{ runner.os }}-gradle-"
},
"name": "Cache",
"uses": "actions/cache@v4"
},
{
"with": {
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/gradle-build-action@v3"
},
{
"uses": "fregante/setup-git-user@v2"
},
{
"name": "Tag Release",
"run": "./gradlew tagRelease",
"id": "tag_release",
"env": {
"BUILD_CACHE_PASSWORD": "${{ secrets.BUILD_CACHE_PASSWORD }}",
"BUILD_CACHE_USER": "${{ secrets.BUILD_CACHE_USER }}",
"BUILD_CACHE_URL": "${{ secrets.BUILD_CACHE_URL }}"
}
},
{
"name": "Build",
"run": "./gradlew build",
"id": "build",
"env": {
"BUILD_CACHE_PASSWORD": "${{ secrets.BUILD_CACHE_PASSWORD }}",
"BUILD_CACHE_USER": "${{ secrets.BUILD_CACHE_USER }}",
"BUILD_CACHE_URL": "${{ secrets.BUILD_CACHE_URL }}"
}
},
{
"run": "git push && git push --tags"
},
{
"name": "Record Version",
"run": "./gradlew recordVersion",
"id": "record_version",
"env": {
"BUILD_CACHE_PASSWORD": "${{ secrets.BUILD_CACHE_PASSWORD }}",
"BUILD_CACHE_USER": "${{ secrets.BUILD_CACHE_USER }}",
"BUILD_CACHE_URL": "${{ secrets.BUILD_CACHE_URL }}"
}
},
{
"name": "Capture Recorded Version",
"run": "echo version=$(cat build/recordVersion.txt) >> \"$GITHUB_OUTPUT\"",
"id": "record_version_capture_version"
}
]
},
"publish": {
"needs": [
"build"
],
"runs-on": "ubuntu-22.04",
"steps": [
{
"name": "Setup Java",
"run": "echo \"JAVA_HOME=$JAVA_HOME_17_X64\" >> \"$GITHUB_ENV\""
},
{
"with": {
"fetch-depth": "0",
"ref": "refs/tags/${{needs.build.outputs.version}}",
"persist-credentials": "false"
},
"name": "Checkout",
"uses": "actions/checkout@v4"
},
{
"with": {
"path": "**/.gradle/loom-cache",
"key": "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}",
"restore-keys": "${{ runner.os }}-gradle-"
},
"name": "Cache",
"uses": "actions/cache/restore@v4"
},
{
"with": {
"cache-read-only": true,
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/gradle-build-action@v3"
},
{
"name": "Publish",
"run": "./gradlew publish closeAndReleaseSonatypeStagingRepository",
"id": "publish",
"env": {
"BUILD_CACHE_PASSWORD": "${{ secrets.BUILD_CACHE_PASSWORD }}",
"BUILD_CACHE_USER": "${{ secrets.BUILD_CACHE_USER }}",
"BUILD_CACHE_URL": "${{ secrets.BUILD_CACHE_URL }}",
"SONATYPE_PASSWORD": "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USER": "${{ secrets.SONATYPE_USER }}",
"GPG_KEY": "${{ secrets.GPG_KEY }}",
"GPG_PASSWORD": "${{ secrets.GPG_PASSWORD }}"
}
}
]
}
},
"name": "Release",
"concurrency": "ci-${{ github.ref }}",
"on": {
"workflow_dispatch": {

}
}
}
76 changes: 76 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"jobs": {
"build": {
"runs-on": "ubuntu-22.04",
"steps": [
{
"name": "Setup Java",
"run": "echo \"JAVA_HOME=$JAVA_HOME_17_X64\" >> \"$GITHUB_ENV\""
},
{
"with": {
"fetch-depth": "0",
"persist-credentials": "false"
},
"name": "Checkout",
"uses": "actions/checkout@v4"
},
{
"with": {
"path": "**/.gradle/loom-cache",
"key": "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}",
"restore-keys": "${{ runner.os }}-gradle-"
},
"name": "Cache",
"uses": "actions/cache/restore@v4"
},
{
"with": {
"cache-read-only": true,
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/gradle-build-action@v3"
},
{
"name": "Build",
"run": "./gradlew build",
"id": "build",
"env": {
"BUILD_CACHE_PASSWORD": "${{ secrets.BUILD_CACHE_PASSWORD }}",
"BUILD_CACHE_USER": "${{ secrets.BUILD_CACHE_USER }}",
"BUILD_CACHE_URL": "${{ secrets.BUILD_CACHE_URL }}",
"SNAPSHOT_MAVEN_PASSWORD": "${{ secrets.SNAPSHOT_MAVEN_PASSWORD }}",
"SNAPSHOT_MAVEN_USER": "github",
"SNAPSHOT_MAVEN_URL": "https://maven.lukebemish.dev/snapshots/"
}
},
{
"name": "Publish",
"run": "./gradlew publish",
"id": "publish",
"env": {
"BUILD_CACHE_PASSWORD": "${{ secrets.BUILD_CACHE_PASSWORD }}",
"BUILD_CACHE_USER": "${{ secrets.BUILD_CACHE_USER }}",
"BUILD_CACHE_URL": "${{ secrets.BUILD_CACHE_URL }}",
"SNAPSHOT_MAVEN_PASSWORD": "${{ secrets.SNAPSHOT_MAVEN_PASSWORD }}",
"SNAPSHOT_MAVEN_USER": "github",
"SNAPSHOT_MAVEN_URL": "https://maven.lukebemish.dev/snapshots/"
}
}
]
}
},
"name": "Snapshot",
"concurrency": "ci-${{ github.ref }}",
"on": {
"workflow_dispatch": {

},
"push": {
"branches": [
"1.*"
]
}
}
}
Loading

0 comments on commit 15eda79

Please sign in to comment.