build #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automatically build the project and run any configured tests for every push | |
# and submitted pull request. This can help catch issues that only occur on | |
# certain platforms or Java versions, and provides a first line of defence | |
# against bad commits. | |
name: build | |
on: | |
workflow_dispatch: | |
inputs: | |
changes: | |
type: string | |
required: true | |
description: "Description to show in changelog" | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
- name: import Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: validate gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: setup jdk 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: "microsoft" | |
- name: cache loom | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.gradle/caches/fabric-loom | |
.gradle/loom-cache | |
build/loom-cache | |
**/build/loom-cache | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
- name: make gradle wrapper executable | |
run: chmod +x ./gradlew | |
- name: build | |
run: ./gradlew build | |
- name: export gradle.properties as env vars | |
run: | | |
export `sed -e '/^#/d' -e '/^org/d' gradle.properties` | |
echo "mod_version=$mod_version" >> $GITHUB_ENV | |
echo "minecraft_version=$minecraft_version" >> $GITHUB_ENV | |
- name: Publich to Modrinth and CurseForge | |
uses: Kir-Antipov/mc-publish@v3.3 | |
with: | |
modrinth-id: fK1LHuQH | |
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | |
modrinth-version: "${{ env.mod_version }}.${{ env.minecraft_version }}" | |
curseforge-id: 971238 | |
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} | |
github-tag: v${{ env.mod_version }}-${{ env.minecraft_version }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
name: "[Fabric ${{env.minecraft_version}}] ${{env.mod_version}}" | |
version: ${{ env.mod_version }} | |
version-type: release | |
loaders: fabric | |
changelog: ${{ inputs.changes}} |