Skip to content

Commit

Permalink
Merge branch 'refs/heads/version/1.20.1' into version/1.19.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle.kts
#	common/src/main/kotlin/module-info.java
#	fabric/build.gradle.kts
#	fabric/gradle.properties
#	fabric/src/main/resources/fabric.mod.json
#	forge/src/main/resources/META-INF/mods.toml
  • Loading branch information
Erdragh committed May 27, 2024
2 parents bd70c87 + 43c4392 commit 2d526ff
Show file tree
Hide file tree
Showing 23 changed files with 381 additions and 311 deletions.
155 changes: 11 additions & 144 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,163 +16,30 @@ permissions:

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
]
# and run on Linux
os: [ ubuntu-latest ]

runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: setup jdk ${{ matrix.java }}
- name: setup jdk 21
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-version: 21
distribution: 'temurin'

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build

- name: Prepare Changelog
run: ./gradlew -q prepareChangelog > prepared_changelog.md

- name: Capture Fabric Artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v4
with:
name: build-fabric
path: fabric/build/libs
- name: Capture Forge Artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v4
with:
name: build-forge
path: forge/build/libs
- name: Capture Changelog
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v4
with:
name: build-changelog
path: prepared_changelog.md

dependencies:
runs-on: ubuntu-latest
if: ${{github.ref == 'refs/heads/version/1.20.1' && github.event_name != 'pull_request'}}
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: setup jdk 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'

- name: Build with Gradle and generate dependency Graph
- name: Publish with Gradle
if: ${{ github.event.inputs.publish }}
uses: gradle/gradle-build-action@v2
with:
arguments: dependencies
dependency-graph: 'generate-and-submit'

publish:
if: ${{ github.event.inputs.publish }}
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download Fabric artifacts
uses: actions/download-artifact@v4
with:
path: build/fabric
pattern: build-fabric
merge-multiple: true
- name: Download Forge artifacts
uses: actions/download-artifact@v4
with:
path: build/forge
pattern: build-forge
merge-multiple: true
- name: Download Changelog
uses: actions/download-artifact@v4
with:
path: .
pattern: build-changelog

- name: List build artifacts
run: ls -R build
- name: Show Changelog
run: cat build-changelog/prepared_changelog.md

- name: Get Version and Platform
id: properties
uses: christian-draeger/[email protected]
with:
path: "./gradle.properties"
properties: "version enabledPlatforms minecraftVersion"
env:
MODRINTH_TOKEN: ${{secrets.MODRINTH_TOKEN}}
CURSEFORGE_TOKEN: ${{secrets.CURSE_TOKEN}}

- name: Upload Forge Releases (Curse/Modrinth/Github)
id: forge_release
if: contains(steps.properties.outputs.enabledPlatforms, 'forge')
uses: Kir-Antipov/[email protected]
MODRINTH_ID: ${{vars.MODRINTH_ID}}
CURSEFORGE_ID: ${{vars.CURSE_ID}}
with:
curseforge-id: ${{ vars.CURSE_ID }}
curseforge-token: ${{ secrets.CURSE_TOKEN }}

modrinth-id: ${{ vars.MODRINTH_ID }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

files: ./build/forge/!(*-@(dev|sources|dev-shadow)).jar
name: "AstralBot ${{ steps.properties.outputs.version }} Forge ${{ steps.properties.output.minecraftVersion }}"
version: ${{ steps.properties.outputs.version }}
version-type: release
changelog-file: build-changelog/prepared_changelog.md
loaders: forge
game-versions: ${{ steps.properties.outputs.minecraftVersion }}

curseforge-dependencies: |
sqlite-jdbc(optional)
kotlin-for-forge(required)
modrinth-dependencies: |
sqlite-jdbc(optional)
kotlin-for-forge(required)
- name: Upload Fabric Releases (Curse/Modrinth/Github)
id: fabric_release
if: contains(steps.properties.outputs.enabledPlatforms, 'fabric')
uses: Kir-Antipov/[email protected]
with:
curseforge-id: ${{ vars.CURSE_ID }}
curseforge-token: ${{ secrets.CURSE_TOKEN }}

modrinth-id: ${{ vars.MODRINTH_ID }}
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

files: ./build/fabric/!(*-@(dev|sources|dev-shadow)).jar
name: "AstralBot ${{ steps.properties.outputs.version }} Fabric ${{ steps.properties.output.minecraftVersion }}"
version: ${{ steps.properties.outputs.version }}
version-type: release
changelog-file: build-changelog/prepared_changelog.md
loaders: fabric
game-versions: ${{ steps.properties.outputs.minecraftVersion }}

curseforge-dependencies: |
fabric-api(required)
fabric-language-kotlin(required)
sqlite-jdbc(optional)
ledger(optional)
modrinth-dependencies: |
fabric-api(required)
fabric-language-kotlin(required)
sqlite-jdbc(optional)
ledger(optional)
arguments: publishMods
26 changes: 26 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build
on:
push:
branches: [ "main", "develop" ]

permissions:
contents: write

jobs:
dependencies:
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v4

- name: setup jdk 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'

- name: Build with Gradle and generate dependency Graph
uses: gradle/gradle-build-action@v2
with:
arguments: dependencies
dependency-graph: 'generate-and-submit'
6 changes: 6 additions & 0 deletions Changelog.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.4.0
- Port to 1.20.4 and NeoForge
- Removed Forge as a supported Platform for Minecraft > 1.20.1
- JiJ SQLite and Commonmark dependencies, allowing better compatibility and removing the SQLite JDBC dependency
- Handle messages sent by commands too (i.e. `say hello`)

# 1.3.0
- Message Embeds to better represent Minecraft messages on Discord
- Fix `/link` Minecraft command not being registered on Forge
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ to see how much is already implemented.

This mod has a few dependencies, some of which are not specified directly as they're technically optional:
- The Kotlin Implementation for the platform you're running. (e.g. [Kotlin For Forge](https://modrinth.com/mod/kotlin-for-forge) or [Fabric Language Kotlin](https://modrinth.com/mod/fabric-language-kotlin))
- The Forge Config API (Included in Forge, [extra mod for Fabric](https://modrinth.com/mod/forge-config-api-port))
- The SQLite Database Driver. (This is included in [Ledger](https://modrinth.com/mod/ledger) but also [available separately](https://modrinth.com/plugin/sqlite-jdbc))
- The (Neo-)Forge Config API (Included in NeoForge, [extra mod for Fabric](https://modrinth.com/mod/forge-config-api-port))

## Implementation
- [JDA](https://jda.wiki) library to communicate with the Discord API.
Expand Down
Loading

0 comments on commit 2d526ff

Please sign in to comment.