Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunekaer committed Feb 2, 2023
1 parent 2474cc4 commit d0ed8c3
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 40 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 }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

All notable changes to this project will be documented in this file.

## [3.0.4]
- Update build script
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ subprojects {

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.19+build.2:v2"
}
}

Expand Down Expand Up @@ -58,3 +55,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 @@ -38,10 +38,10 @@ publishing {
repositories {
if (ENV.NANITE_DEPLOY) {
maven {
url "https://maven.nanite.dev/"
url "https://maven.nanite.dev/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_DEPLOY}"
password = "${ENV.NANITE_TOKEN}"
}
}
}
Expand Down
12 changes: 7 additions & 5 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,19 @@ publishing {
repositories {
if (ENV.NANITE_DEPLOY) {
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 = "release"
Expand All @@ -117,8 +117,10 @@ if (ENV.CURSE_DEPLOY) {
requiredDependency 'architectury-api'
requiredDependency 'cloth-config'
}
changelog = getGitChangelog
changelog = file("../CHANGELOG.md")
changelogType = 'markdown'
}
}
}

rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")
8 changes: 5 additions & 3 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ publishing {
}
}

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 @@ -118,8 +118,10 @@ if (ENV.CURSE_DEPLOY) {
requiredDependency 'architectury-api'
requiredDependency 'cloth-config'
}
changelog = getGitChangelog
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=SimpleDiscordRichPresence
mod_version=3.0.3
mod_version=3.0.4
maven_group=com.sunekaer.mods

curseforge_id=334853
Expand Down

0 comments on commit d0ed8c3

Please sign in to comment.