Skip to content

Commit

Permalink
Fix create integration (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNijjar committed Aug 4, 2023
1 parent e5e4964 commit e81bfed
Show file tree
Hide file tree
Showing 17 changed files with 197 additions and 58 deletions.
106 changes: 78 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,92 @@
name: Release
on: [
workflow_dispatch
]

name: Publish Release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
publish-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
- name: Checkout Repository
uses: actions/checkout@v2

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
distribution: 'temurin'
java-version: 17
- name: Cache Gradle packages

- name: Setup Gradle Caches
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: ${{ runner.os }}-gradle
- run: chmod +x ./gradlew

- name: Release
run: ./gradlew :fabric:modrinth :forge:modrinth :fabric:curseforge :forge:curseforge
env:
CURSE_TOKEN: ${{ secrets.CURSE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
- name: Setup Gradle Wrapper
run: chmod +x gradlew

- run: ./gradlew generateDiscordEmbed
- name: Get Version and Platform
id: properties
uses: christian-draeger/read-properties@1.1.1
with:
path: "./gradle.properties"
properties: "version enabledPlatforms minecraftVersion"

- name: Publish Release
run: ./gradlew publish --info
env:
MODRINTH_PROJECT_URL: ${{ secrets.MODRINTH_PROJECT_URL }}
CURSE_PROJECT_URL: ${{ secrets.CURSE_PROJECT_URL }}
EMBED_COLOR: ${{ secrets.EMBED_COLOR }}
WEBHOOK_THUMBNAIL: ${{ secrets.WEBHOOK_THUMBNAIL }}
WEBHOOK_USERNAME: ${{ secrets.WEBHOOK_USERNAME }}
WEBHOOK_AVATAR: ${{ secrets.WEBHOOK_AVATAR }}

- name: Trigger Discord Webhook
MAVEN_USER: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASS: ${{ secrets.MAVEN_PASSWORD }}

- name: Upload Forge Releases (Curse/Modrinth/Github)
if: contains(steps.properties.outputs.enabledPlatforms, 'forge')
uses: Kir-Antipov/mc-publish@v3.2
with:
curseforge-id: ${{ vars.CURSE_ID }}
curseforge-token: ${{ secrets.CURSE_TOKEN }}

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

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

dependencies: |
resourceful-lib | depends | *
- name: Upload Fabric Releases (Curse/Modrinth/Github)
if: contains(steps.properties.outputs.enabledPlatforms, 'fabric')
uses: Kir-Antipov/mc-publish@v3.2
with:
curseforge-id: ${{ vars.CURSE_ID }}
curseforge-token: ${{ secrets.CURSE_TOKEN }}

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

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

dependencies: |
fabric-api | depends | *
resourceful-lib | depends | *
- name: Generate Discord Embed
run: ./gradlew injectEmbed

- name: Upload Discord Embed
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.WEBHOOK_URL }}
raw-data: embed.json
raw-data: ./build/embed.json
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
java
id("maven-publish")
id("com.teamresourceful.resourcefulgradle") version "0.0.+"
id("dev.architectury.loom") version "1.2-SNAPSHOT" apply false
id("dev.architectury.loom") version "1.3-SNAPSHOT" apply false
id("architectury-plugin") version "3.4-SNAPSHOT"
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
}
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix create integration
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"results": [
{
"item": "handcrafted:acacia_board",
"count": 2,
"chance": 0.25
"count": 4
}
],
"processingTime": 10
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"create"
]
}
],
"conditions": [
{
"type": "forge:mod_loaded",
"modid": "create"
}
],
"type": "create:cutting",
"ingredients": [
{
"item": "minecraft:bamboo_planks"
}
],
"results": [
{
"item": "handcrafted:bamboo_board",
"count": 4
}
],
"processingTime": 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"results": [
{
"item": "handcrafted:birch_board",
"count": 2,
"chance": 0.25
"count": 4
}
]
],
"processingTime": 10
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"create"
]
}
],
"conditions": [
{
"type": "forge:mod_loaded",
"modid": "create"
}
],
"type": "create:cutting",
"ingredients": [
{
"item": "minecraft:cherry_planks"
}
],
"results": [
{
"item": "handcrafted:cherry_board",
"count": 4
}
],
"processingTime": 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"results": [
{
"item": "handcrafted:crimson_board",
"count": 2,
"chance": 0.1
"count": 4
}
],
"processingTime": 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"results": [
{
"item": "handcrafted:dark_oak_board",
"count": 4,
"chance": 0.1
"count": 4
}
]
],
"processingTime": 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"results": [
{
"item": "handcrafted:jungle_board",
"count": 3,
"chance": 0.25
"count": 4
}
]
],
"processingTime": 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"results": [
{
"item": "handcrafted:mangrove_board",
"count": 4,
"chance": 0.1
"count": 4
}
]
],
"processingTime": 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"results": [
{
"item": "handcrafted:oak_board",
"count": 4,
"chance": 0.1
"count": 4
}
]
],
"processingTime": 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"results": [
{
"item": "handcrafted:spruce_board",
"count": 4,
"chance": 0.1
"count": 4
}
]
],
"processingTime": 10
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"results": [
{
"item": "handcrafted:warped_board",
"count": 4,
"chance": 0.1
"count": 4
}
]
],
"processingTime": 10
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ org.gradle.jvmargs=-Xmx2G

enabledPlatforms=fabric,forge

version=3.0.0
version=3.0.1
group=earth.terrarium.handcrafted

minecraftVersion=1.20.1
parchmentVersion=2023.07.02
parchmentVersion=2023.07.30

resourcefulLibVersion=2.1.1
resourcefulLibVersion=2.1.8
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
32 changes: 32 additions & 0 deletions templates/embed.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"embeds": [
{
"title": "Handcrafted",
"description": "**Changelog:**\\n${changelog}",
"color": 5814783,
"fields": [
{
"name": "Minecraft Version",
"value": "${minecraft}"
},
{
"name": "Mod Version",
"value": "${version}"
},
{
"name": "Download",
"value": "<:modrinth:1083795635414773760> [Modrinth](https://modrinth.com/mod/handcrafted)\\n<:curseforge:978684543026462790> [Curseforge](https://www.curseforge.com/minecraft/mc-mods/handcrafted)"
}
],
"footer": {
"text": "Want to support us? Check out our Ko-fi! http://kofi.terrarium.earth",
"icon_url": "https://raw.githubusercontent.com/terrarium-earth/Handcrafted/1.20.x/common/src/main/resources/icon.png"
},
"thumbnail": {
"url": "https://cdn.discordapp.com/attachments/1094731881590833203/1106096454650568775/Cadmus_image.png"
}
}
],
"username": "Terrarium Releases",
"avatar_url": "https://cdn.discordapp.com/avatars/955572264823300096/3c226580b871a57b6da095fea1cccf1e.webp"
}

0 comments on commit e81bfed

Please sign in to comment.