Skip to content

Commit

Permalink
Merge branch 'mc21.1/2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
robotgryphon committed Nov 17, 2024
2 parents 0a67916 + 1de4a11 commit 87db039
Show file tree
Hide file tree
Showing 44 changed files with 1,304 additions and 470 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Data Generation

on:
workflow_call:
inputs:
version:
required: true
type: string

jobs:
datagen:
name: Build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build
run: ./gradlew :spatial-neoforge:build
env:
VERSION: ${{ inputs.version }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Store Compiled
if: success()
uses: actions/upload-artifact@v4
with:
name: build
path: spatial/build

- name: Store Compiled
if: success()
uses: actions/upload-artifact@v4
with:
name: build-neo
path: spatial-neoforge/build
48 changes: 48 additions & 0 deletions .github/workflows/_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# REQUIRES DATAGEN TO BE CALLED IN A JOB BEFORE THIS!!

name: Publish

on:
workflow_call:
inputs:
version:
required: true
type: string

jobs:
publish:
name: Publish Code as Github Package - ${{ inputs.version }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Pull Compilation Data
uses: actions/download-artifact@v4
with:
name: build
path: spatial/build

- name: Pull Compilation Data (Main)
uses: actions/download-artifact@v4
with:
name: build-neo
path: spatial-neoforge/build

- name: Publish
run: ./gradlew :spatial:publish
env:
VERSION: ${{ inputs.version }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64 changes: 64 additions & 0 deletions .github/workflows/_run-gametests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Run Game Tests

on:
workflow_call:
inputs:
version:
required: true
type: string

env:
VERSION: ${{ inputs.version }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
run-tests:
name: Run Game Tests
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Pull Compilation Data
uses: actions/download-artifact@v4
with:
name: build
path: spatial/build

- name: Pull Compilation Data (Main)
uses: actions/download-artifact@v4
with:
name: build-neo
path: spatial-neoforge/build

- name: Run Game Tests
run: ./gradlew :spatial-neoforge:runGameTestServer

- name: Upload test failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-data
path: run/gametest

- name: Run JUnit Tests
run: ./gradlew :spatial-neoforge:test

- name: Upload test reports on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: spatial-neoforge/build/reports
57 changes: 57 additions & 0 deletions .github/workflows/nightly-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Publish and Announce Nightly Build

env:
GH_PKG_URL: "https://maven.pkg.github.com/${{ github.repository }}"

on:
workflow_dispatch:
push:
paths-ignore:
- "README.md"
- "LICENSE"
- ".github/**/*"
- "**/*.gradle.kts"
- "**/gradle.properties"

jobs:
vars:
name: Get Variables
runs-on: ubuntu-22.04
outputs:
version: ${{steps.version.outputs.version}}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 150
fetch-tags: true

- name: Version
id: version
uses: paulhatch/[email protected]
with:
change_path: "spatial"
version_format: "${major}.${minor}.${patch}"
search_commit_body: true

build:
needs: [ vars ]
uses: ./.github/workflows/_build.yml
secrets: inherit
with:
version: ${{ needs.vars.outputs.version }}

tests:
needs: [ build, vars ]
uses: ./.github/workflows/_run-gametests.yml
secrets: inherit
with:
version: ${{ needs.vars.outputs.version }}

publish:
needs: [ vars, tests ]
uses: ./.github/workflows/_publish.yml
secrets: inherit
with:
version: ${{ needs.vars.outputs.version }}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ bin/

### Mac OS ###
.DS_Store
runs/
spatial/runs/

run/

logs/

spatial-neoforge/runs/

.idea/
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/discord.xml

This file was deleted.

16 changes: 0 additions & 16 deletions .idea/gradle.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

40 changes: 1 addition & 39 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
plugins {
id("idea")
id("java")
id("net.neoforged.gradle.userdev") version "7.0.96"
}

base {
archivesName = "spatial"
group = "dev.compactmods"
version = "0.1.0"
}

java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}

repositories {
mavenCentral()
}

idea {

}

minecraft.modIdentifier("spatial")

runs.create("gameTestServer") {
this.gameTest()
systemProperty("forge.enabledGameTestNamespaces", "spatial")
environmentVariables("TEST_RESOURCES", project.file("src/test/resources").path)

modSource(sourceSets.main.get())
modSource(sourceSets.test.get())
}

dependencies {
// compileOnly("net.minecraft:neoform_joined:1.20.4-20231207.154220")

implementation(libraries.neoforge)
testImplementation(libraries.neoforge)
alias(neoforged.plugins.moddev).apply(false)
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Sun Feb 25 23:57:21 EST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 87db039

Please sign in to comment.