Skip to content

Commit

Permalink
compile with correct version
Browse files Browse the repository at this point in the history
  • Loading branch information
Boxadactle committed Aug 18, 2024
1 parent d9cfe7b commit eaad921
Show file tree
Hide file tree
Showing 8 changed files with 122 additions and 61 deletions.
47 changes: 25 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,30 @@ permissions:
jobs:
build:

runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

- name: Build with Gradle
run: ./gradlew build

- name: Upload fabric
uses: actions/upload-artifact@v3
with:
name: fabric-build
path: fabric/build/libs

- name: Upload forge
uses: actions/upload-artifact@v3
with:
name: forge-build
path: forge/build/libs
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up gradlew
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Upload fabric
uses: actions/upload-artifact@v4
with:
name: fabric-build
path: fabric/build/libs

- name: Upload forge
uses: actions/upload-artifact@v4
with:
name: forge-build
path: forge/build/libs
26 changes: 26 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Compile
on: [ push, pull_request ]

permissions:
contents: read

jobs:
compile:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up gradlew
run: chmod +x ./gradlew

- name: Compile java
run: ./gradlew compileJava
72 changes: 38 additions & 34 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,49 @@
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Publish
on:
push:
branches: [ "latest" ]
pull_request:
branches: [ "latest" ]
on: [ workflow_dispatch ]

permissions:
contents: read

jobs:
build:
publish:

runs-on: windows-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

- name: Build with Gradle
run: ./gradlew build

- name: Upload fabric
uses: actions/upload-artifact@v3
with:
name: fabric-build
path: fabric/build/libs

- name: Upload forge
uses: actions/upload-artifact@v3
with:
name: forge-build
path: forge/build/libs

- name: Publish
run: ./gradlew publishUnified
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up gradlew
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Upload fabric
uses: actions/upload-artifact@v4
with:
name: fabric-build
path: fabric/build/libs

- name: Upload neoforge
uses: actions/upload-artifact@v4
with:
name: neoforge-build
path: neoforge/build/libs

- name: Publish
run: ./gradlew publishUnified
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}

- name: Create GitHub release
run: ./gradlew githubRelease
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_TOKEN }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Changes
- Now compiled with the correct java version
26 changes: 26 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'architectury-plugin' version '3.4-SNAPSHOT'
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id "me.shedaniel.unified-publishing" version "0.1.+"
id "com.github.breadmoirai.github-release" version "2.5.2"
}

architectury {
Expand Down Expand Up @@ -66,3 +67,28 @@ subprojects {
}
}
}


githubRelease {
owner = "Boxadactle"
repo = "coordinates-display"
tagName = "$project.version"
targetCommitish = "latest"
releaseName = "Coordinates Display $project.version"
generateReleaseNotes = true
body = """Coordinates Display $project.version for Minecraft $project.minecraft_version
${new File(rootProject.rootDir, project.changelog_file).text}
"""
authorization = "Token ${System.getenv("GITHUB_TOKEN")}"

var files = []
for (String platform : project.enabled_platforms.split(',')) {
files += fileTree("$platform/build/libs") {
include "*$project.version*"
}
}
releaseAssets = files

// dryRun = true
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CoordinatesDisplay {

public static final String MOD_ID = "coordinatesdisplay";

public static final String VERSION = "2.4.0";
public static final String VERSION = "2.4.1";

public static final String VERSION_STRING = MOD_NAME + " v" + VERSION;

Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ unifiedPublishing {
project {
displayName = "[Fabric ${rootProject.minecraft_version}] v$rootProject.mod_version"
version = "$rootProject.version-fabric"
changelog = "A changelog can be found here: ${rootProject.releases_page}tag/$rootProject.mod_version"
changelog = "A changelog can be found here: https://github.com/Boxadactle/coordinates-display/releases/tag/$rootProject.mod_version"
releaseType = rootProject.release_type
gameVersions = Arrays.asList(rootProject.game_versions.split(","))
gameLoaders = [ "fabric", "quilt" ]
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

# Mod properties
mod_version = 2.4.0
mod_version = 2.4.1
maven_group = dev.boxadactle
archives_name = CoordinatesDisplay
enabled_platforms = fabric
Expand All @@ -17,11 +17,11 @@ fabric_api_version = 0.28.5+1.15
forge_version = 31.2.57

modmenu_version = 1.10.4+build.1
boxlib_version = 3.0.0
boxlib_version = 3.0.2

# publishing
game_versions = 1.15.2
project_id_curseforge = 646464
project_id_modrinth = 3mW8PdUo
release_type = release
releases_page = https://github.com/Boxadactle/coordinates-display/releases/
changelog_file = CHANGELOG.md

0 comments on commit eaad921

Please sign in to comment.