Skip to content

restore curio compat #552

restore curio compat

restore curio compat #552

Workflow file for this run

name: Build and upload mod
on:
push:
branches:
- 'main'
release:
types: [ published ]
branches:
- 'main'
jobs:
setup:
if: ${{ contains(github.event.head_commit.message, 'version bump for release') && github.event_name != 'release' }}
name: Generate file path
runs-on: ubuntu-latest
outputs:
mod_name: ${{steps.moddetails.outputs.mod_name}}
mod_version: ${{steps.moddetails.outputs.mod_version}}
java_version: ${{steps.moddetails.outputs.java_version}}
mc_patch_version: ${{steps.patchversion.outputs.mc_patch_version}}
mc_minor_version: ${{steps.minorversion.outputs.mc_minor_version}}
file_path: ${{steps.filepath.outputs.file_path}}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Details
id: moddetails
run: |
echo "mod_name=$(cat ./gradle.properties | sed -n 's/mod_id \= //p' | tr -d "'")" >> $GITHUB_OUTPUT
echo "mod_version=$(cat ./gradle.properties | sed -n 's/mod_version \= //p' | tr -d "'")" >> $GITHUB_OUTPUT
echo "java_version=$(cat ./build.gradle | grep -o -P '(?<=JavaLanguageVersion.of\().*(?=\))')" >> $GITHUB_OUTPUT
- name: MC Patch Version
id: patchversion
run: echo "mc_patch_version=$(cat ./gradle.properties | sed -n 's/minecraft_version \= //p' | tr -d "'")" >> $GITHUB_OUTPUT
- name: MC Minor Version
id: minorversion
run: echo "mc_minor_version=$(echo ${{ steps.patchversion.outputs.mc_patch_version }} | awk -F. '{ print $1"."$2 }')" >> $GITHUB_OUTPUT
- name: Get Details
id: filepath
run: echo "file_path=./build/libs/${{ steps.moddetails.outputs.mod_name }}-${{ steps.patchversion.outputs.mc_patch_version}}-${{ steps.moddetails.outputs.mod_version }}.jar" >> $GITHUB_OUTPUT
build:
name: Build and cache
runs-on: ubuntu-latest
needs: [ setup ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '${{ needs.setup.outputs.java_version }}'
distribution: 'adopt'
cache: 'gradle'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate Data
run: ./gradlew rundata
- name: Build
run: ./gradlew :build
- name: Cache
uses: actions/cache@v3
with:
path: |
${{ needs.setup.outputs.file_path }}
CHANGELOG.md
key: ${{ github.sha }}
upload:
name: Upload to ModRepo
runs-on: ubuntu-latest
needs: [ setup,build ]
steps:
- name: Restore Cache
uses: actions/cache@v3
with:
path: |
${{ needs.setup.outputs.file_path }}
CHANGELOG.md
key: ${{ github.sha }}
- name: Upload to CurseForge
if: ${{ vars.MODREPO == 'curseforge' || vars.MODREPO == 'both' }}
uses: Kir-Antipov/mc-publish@v3.3
with:
curseforge-id: 353935
curseforge-token: ${{ secrets.curseforge_api }}
files: ${{ needs.setup.outputs.file_path }}
name: ${{ needs.setup.outputs.mod_name }}-1.21-${{ needs.setup.outputs.mod_version }}
version: ${{ needs.setup.outputs.mod_version }}
changelog-file: CHANGELOG.md
loaders: |
neoforge
game-versions: |
1.21
1.21.1
java: |
${{ needs.setup.outputs.java_version }}
- name: Upload to Modrinth
if: ${{ vars.MODREPO == 'modrinth' || vars.MODREPO == 'both' }}
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: KFQYC1Uy
modrinth-token: ${{ secrets.modrinth_api }}
files: ${{ needs.setup.outputs.file_path }}
name: ${{ needs.setup.outputs.mod_name }}-1.21-${{ steps.patchversion.outputs.mc_patch_version}}-${{ needs.setup.outputs.mod_version }}
version: ${{ needs.setup.outputs.mod_version }}
changelog-file: CHANGELOG.md
loaders: |
neoforge
game-versions: |
1.21
1.21.1
java: |
${{ needs.setup.outputs.java_version }}
message:
name: send discord update messaage
runs-on: ubuntu-latest
needs: [ setup,build,upload ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Read changelog
id: changelog
uses: juliangruber/read-file-action@v1
with:
path: CHANGELOG.md
- name: Discord Webhook Action
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
username: Project MMO Updates
content: ${{ steps.changelog.outputs.content }}