Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaz492 committed Jan 22, 2023
1 parent 5907483 commit beaa2b5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 40 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,9 @@ on:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 30 # Gets the last 30 commits so the changelog might work
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: Build & release to curseforge
env:
GIT_COMMIT: ${{ github.event.after }}
GIT_PREVIOUS_COMMIT: ${{ github.event.before }}
NANITE_DEPLOY : ${{ secrets.NANITE_DEPLOY }}
CURSE_DEPLOY: ${{ secrets.CURSE_DEPLOY }}
run: |
chmod +x ./gradlew
./gradlew build publish curseforge --stacktrace --no-daemon
if: |
!contains(github.event.head_commit.message, '[ciskip]')
uses: nanite/workflows/.github/workflows/standard-release.yml@v1
secrets:
nanite-token: ${{ secrets.NANITE_DEPLOY }}
curse-token: ${{ secrets.CURSE_DEPLOY }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [2.1.1]
- Build script update

## [2.1.0]
- Updated to 1.19.3

Expand Down
24 changes: 5 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,13 @@ version = "${mod_version}-build.${ENV.GITHUB_RUN_NUMBER ?: 9999}+mc${minecraft_v
group = project.maven_group

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
// mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
}

Expand All @@ -41,14 +33,10 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}

Expand All @@ -58,7 +46,6 @@ jar {
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
Expand All @@ -67,23 +54,22 @@ publishing {
}
}

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
if (ENV.NANITE_DEPLOY) {
if (ENV.NANITE_TOKEN) {
maven {
url "https://maven.nanite.dev/"
url "https://maven.nanite.dev/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_DEPLOY}"
password = "${ENV.NANITE_TOKEN}"
}
}
}
}
}

if (ENV.CURSE_DEPLOY) {
if (ENV.CURSE_TOKEN) {
curseforge {
apiKey = ENV.CURSE_DEPLOY
apiKey = ENV.CURSE_TOKEN
project {
id = project.curseforge_id
releaseType = "beta"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minecraft_version=1.19.3
yarn_mappings=1.19.3+build.2
loader_version=0.14.11
# Mod Properties
mod_version=2.1.0
mod_version=2.1.1
maven_group=dev.wuffs
archives_base_name=BetterCompatibilityChecker-Fabric
# Dependencies
Expand Down

0 comments on commit beaa2b5

Please sign in to comment.