Skip to content

Commit

Permalink
Add publishing to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
js6pak committed Apr 8, 2022
1 parent ad6321c commit 9d70c21
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,31 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 17
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: build
run: ./gradlew build
- name: capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: false
body_path: CHANGELOG.md
files: build/libs/*.jar
- name: modrinth
if: startsWith(github.ref, 'refs/tags/')
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: ./gradlew modrinth
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Rewrite
- Port to [babric](https://babric.github.io/)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ Allows the server to verify that the connecting player is logged in

<details><summary>Inventory tweaks</summary>

<video src="https://user-images.githubusercontent.com/35262707/159063818-e450561d-f13d-435a-b46b-879cc54a8a0f.mp4" />
<video controls src="https://user-images.githubusercontent.com/35262707/159063818-e450561d-f13d-435a-b46b-879cc54a8a0f.mp4" />
</details>
18 changes: 17 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'babric-loom' version '0.12-SNAPSHOT'
id "maven-publish"
id("com.modrinth.minotaur") version "2.+"
id "com.diffplug.spotless" version "6.2.2"
}

Expand All @@ -11,7 +12,12 @@ group = project.maven_group

def ENV = System.getenv()
if (ENV.GITHUB_RUN_NUMBER) {
version = project.mod_version + '-ci.' + ENV.GITHUB_RUN_NUMBER
if (ENV.GITHUB_REF && ENV.GITHUB_REF.startsWith("refs/tags/")) {
version = project.mod_version
spotless.enforceCheck = false
} else {
version = project.mod_version + '-ci.' + ENV.GITHUB_RUN_NUMBER
}
} else {
version = project.mod_version + '+local'
}
Expand Down Expand Up @@ -68,3 +74,13 @@ spotless {
licenseHeaderFile(rootProject.file("HEADER"))
}
}

modrinth {
projectId = "8sdj2JBj"
uploadFile = remapJar
gameVersions = [project.minecraft_version]
loaders = ["fabric"]
changelog = rootProject.file("CHANGELOG.md").text
syncBodyFrom = rootProject.file("README.md").text
}
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)

0 comments on commit 9d70c21

Please sign in to comment.