Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: build mod

on:
push:
branches:
- '**'
pull_request:
branches:
- '*'
Expand Down
218 changes: 118 additions & 100 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,106 +1,124 @@


name: 'Publish to Modrinth & CurseForge'

on:
workflow_run:
workflows: ['build mod']
types: [completed]
branches: [ '1.20.1']
pull_request:
types: [closed]
branches:
- '1.20.1'
path: 'CHANGELOG.md'

jobs:
build:
runs-on: ubuntu-latest
outputs:
artifact_name: ${{ steps.vars.outputs.artifact_name }}
artifact_path: ${{ steps.vars.outputs.artifact_path }}
mc_version: ${{ steps.vars.outputs.mc_version }}
mod_version: ${{ steps.vars.outputs.mod_version }}
mod_loader: ${{ steps.vars.outputs.mod_loader }}
version_type: ${{ steps.vars.outputs.version_type }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Read Variables from gradle.properties
id: vars
run: |
java_version=$(grep '^java_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "java_version=$java_version" >> $GITHUB_OUTPUT
mc_version=$(grep '^minecraft_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "mc_version=$mc_version" >> $GITHUB_OUTPUT
mod_version=$(grep '^mod_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "mod_version=$mod_version" >> $GITHUB_OUTPUT
mod_loader=$(grep '^mod_loader=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "mod_loader=$mod_loader" >> $GITHUB_OUTPUT
version_type=$(grep '^version_type=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "version_type=$version_type" >> $GITHUB_OUTPUT
echo artifact_path=build/libs/ExtendedTerminal-$mc_version-$mod_version.jar >> $GITHUB_OUTPUT
echo artifact_name=ExtendedTerminal-$mc_version-$mod_version >> $GITHUB_OUTPUT
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: ${{ steps.vars.outputs.java_version }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.vars.outputs.artifact_name }}
path: |
${{ steps.vars.outputs.artifact_path }}
CHANGELOG.md
publish-to-curseforge:
if: github.event.workflow_run.event == 'push'
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build-artifact
uses: actions/[email protected]
with:
name: ${{ needs.build.outputs.artifact_name }}
- name: Publish to Modrinth & CurseForge
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 1302078
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

changelog-file: 'CHANGELOG.md'
game-versions: ${{ needs.build.outputs.mc_version }}
loaders: ${{ needs.build.outputs.mc_loader }}
version-type: ${{ needs.build.outputs.version_type }}

files: '*.jar'
name: ${{ needs.build.outputs.artifact_name }}
version: ${{ needs.build.outputs.mc_version }}-${{ needs.build.outputs.mod_version }}
publish-to-modrinth:
if: github.event.workflow_run.event == 'push'
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build-artifact
uses: actions/[email protected]
with:
name: built-artifact
- name: Publish to Modrinth & CurseForge
uses: Kir-Antipov/[email protected]
with:
modrinth-id: extended-terminal
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

changelog-file: 'CHANGELOG.md'
game-versions: ${{ needs.build.outputs.mc_version }}
loaders: ${{ needs.build.outputs.mc_loader }}
version-type: ${{ needs.build.outputs.version_type }}

files: '*.jar'
name: ${{ needs.build.outputs.artifact_name }}
version: ${{ needs.build.outputs.mc_version }}-${{ needs.build.outputs.mod_version }}
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
artifact_name: ${{ steps.vars.outputs.artifact_name }}
artifact_path: ${{ steps.vars.outputs.artifact_path }}
mc_version: ${{ steps.vars.outputs.mc_version }}
mod_version: ${{ steps.vars.outputs.mod_version }}
mod_loader: ${{ steps.vars.outputs.mod_loader }}
version_type: ${{ steps.vars.outputs.version_type }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Read Variables from gradle.properties
id: vars
run: |
java_version=$(grep '^java_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "java_version=$java_version" >> $GITHUB_OUTPUT
mc_version=$(grep '^minecraft_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "mc_version=$mc_version" >> $GITHUB_OUTPUT
mod_version=$(grep '^mod_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "mod_version=$mod_version" >> $GITHUB_OUTPUT
mod_loader=$(grep '^mod_loader=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "mod_loader=$mod_loader" >> $GITHUB_OUTPUT
version_type=$(grep '^version_type=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')
echo "version_type=$version_type" >> $GITHUB_OUTPUT
echo artifact_path=build/libs/ExtendedTerminal-$mc_version-$mod_version.jar >> $GITHUB_OUTPUT
echo artifact_name=ExtendedTerminal-$mc_version-$mod_version >> $GITHUB_OUTPUT
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: ${{ steps.vars.outputs.java_version }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Make gradlew executable
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.vars.outputs.artifact_name }}
path: |
${{ steps.vars.outputs.artifact_path }}
CHANGELOG.md
publish-to-curseforge:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build-artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
- name: Publish to Modrinth & CurseForge
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 1302078
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

changelog-file: 'CHANGELOG.md'
game-versions: ${{ needs.build.outputs.mc_version }}
loaders: ${{ needs.build.outputs.mod_loader }}
version-type: ${{ needs.build.outputs.version_type }}

files: 'build/libs/*.jar'
name: ${{ needs.build.outputs.artifact_name }}
version: ${{ needs.build.outputs.mc_version }}-${{ needs.build.outputs.mod_version }}

dependencies: |
ae2(required){modrinth:XxWD5pD3}{curseforge:223794}
ae2wtlib(optional){modrinth:pNabrMMw}{curseforge:459929}
extendedcrafting(optional){modrinth:5JMG1gql}{curseforge:1083158}
avaritianeo(optional){modrinth:j5gjLUvf}{curseforge:268387}
re-avaritia(optional){modrinth:QeB3NRC5}{curseforge:623969}

publish-to-modrinth:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build-artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
- name: Publish to Modrinth & CurseForge
uses: Kir-Antipov/[email protected]
with:
modrinth-id: SwdQUhgJ
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

changelog-file: 'CHANGELOG.md'
game-versions: ${{ needs.build.outputs.mc_version }}
loaders: ${{ needs.build.outputs.mod_loader }}
version-type: ${{ needs.build.outputs.version_type }}

files: 'build/libs/*.jar'
name: ${{ needs.build.outputs.artifact_name }}
version: ${{ needs.build.outputs.mc_version }}-${{ needs.build.outputs.mod_version }}

dependencies: |
ae2(required){modrinth:XxWD5pD3}{curseforge:223794}
ae2wtlib(optional){modrinth:pNabrMMw}{curseforge:459929}
extendedcrafting(optional){modrinth:5JMG1gql}{curseforge:1083158}
avaritianeo(optional){modrinth:j5gjLUvf}{curseforge:268387}
re-avaritia(optional){modrinth:QeB3NRC5}{curseforge:623969}
Loading