diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..1ffba38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,16 @@ +--- +name: Bug +about: report bug/error +title: "[BUG]" +labels: bug +assignees: N-Joy-Shadow + +--- + +**Describe the bug** + +**To Reproduce** + +**mod list / modpack ** + +**Screenshots** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..167b685 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,10 @@ +--- +name: Feature request +about: Share your idea +title: "[Feature]" +labels: feature +assignees: N-Joy-Shadow + +--- + +request more terminal? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..77c104f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +## Related Issue +> If not present, skip it. + + +## PR summary + + +## ScreenShot (Optional) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..79da49a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: build mod + +on: + push: + branches: + - '**' + pull_request: + branches: + - '*' + +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 }} + 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 + 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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..aee9adb --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,106 @@ + +name: 'Publish to Modrinth & CurseForge' + +on: + workflow_run: + workflows: ['build mod'] + types: [completed] + branches: [ '1.20.1', ] + +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/download-artifact@6.0.0 + with: + name: ${{ needs.build.outputs.artifact_name }} + - name: Publish to Modrinth & CurseForge + uses: Kir-Antipov/mc-publish@v3.3 + 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/download-arrtifact@6.0.0 + with: + name: built-artifact + - name: Publish to Modrinth & CurseForge + uses: Kir-Antipov/mc-publish@v3.3 + 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 }} diff --git a/gradle.properties b/gradle.properties index 10ca4db..3d3e60f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,8 +10,11 @@ mapping_version=1.20.1 mod_id=extendedterminal mod_name=Extended Terminal mod_license=GNU LGPL 3.0 -mod_version=0.1.1 +mod_loader=forge +mod_version=0.1.2 mod_group_id=me.myogoo +java_version=17 +mod_version_type=beta mod_authors=NJoyShadow mod_description=Add some terminal like extended crafting