Skip to content

Commit

Permalink
Updated build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaz492 committed Jan 22, 2023
1 parent b12a79e commit b1cfda0
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 36 deletions.
32 changes: 6 additions & 26 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,9 @@ on:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/checkout@v2
with:
fetch-depth: 30 # Gets the last 30 commits so the changelog might work
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- 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-arch-release.yml@v1
secrets:
nanite-token: ${{ secrets.NANITE_DEPLOY }}
curse-token: ${{ secrets.CURSE_DEPLOY }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

## [2.0.3]

- Update build script
- Added cloth config as required dep

## [2.0.1]

- Forge/Fabric bump
Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ allprojects {
withSourcesJar()
}
}

task curseforgePublish
4 changes: 2 additions & 2 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ publishing {
}

repositories {
if (ENV.NANITE_DEPLOY) {
if (ENV.NANITE_TOKEN) {
maven {
url "https://maven.nanite.dev/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_DEPLOY}"
password = "${ENV.NANITE_TOKEN}"
}
}
}
Expand Down
11 changes: 7 additions & 4 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ publishing {
}

repositories {
if (ENV.NANITE_DEPLOY) {
if (ENV.NANITE_TOKEN) {
maven {
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 = "release"
Expand All @@ -109,10 +109,13 @@ if (ENV.CURSE_DEPLOY) {
relations {
requiredDependency 'fabric-api'
requiredDependency 'architectury-api'
requiredDependency 'cloth-config'
}
mainArtifact(remapJar.archivePath)
changelog = file("../CHANGELOG.md")
changelogType = 'markdown'
}
}
}

rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")
7 changes: 5 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ 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/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_DEPLOY}"
password = "${ENV.NANITE_TOKEN}"
}
}
}
Expand All @@ -113,10 +113,13 @@ if (ENV.CURSE_DEPLOY) {
addGameVersion "${minecraft_version}"
relations {
requiredDependency 'architectury-api'
requiredDependency 'cloth-config'
}
mainArtifact(remapJar)
changelog = file("../CHANGELOG.md")
changelogType = 'markdown'
}
}
}

rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version=1.18.2
enabled_platforms=fabric,forge

archives_base_name=squatgrow
mod_version=2.0.2
mod_version=2.0.3
maven_group=dev.wuffs

architectury_version=4.9.83
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ include("common")
include("fabric")
include("forge")

rootProject.name = "architectury-example-mod"
rootProject.name = "SquatGrow"

0 comments on commit b1cfda0

Please sign in to comment.