Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed May 29, 2024
0 parents commit 23013ed
Show file tree
Hide file tree
Showing 106 changed files with 3,489 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build
on:
push:
branches:
- '**'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
loader: [fabric, forge, neoforge]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Build API
run: ./gradlew :kuma-api:${{ matrix.loader }}:build
env:
GPR_USERNAME: ${{secrets.GPR_USERNAME}}
GPR_TOKEN: ${{secrets.GPR_TOKEN}}
GPR_BUILD_NUMBER: ${{github.run_number}}
- name: Build
run: ./gradlew :kuma:${{ matrix.loader }}:build
env:
GPR_USERNAME: ${{secrets.GPR_USERNAME}}
GPR_TOKEN: ${{secrets.GPR_TOKEN}}
GPR_BUILD_NUMBER: ${{github.run_number}}
102 changes: 102 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: publish-release
on:
workflow_dispatch:
inputs:
bump:
description: 'The bump in version for this release'
required: true
type: choice
default: patch
options:
- major
- minor
- patch

jobs:
create-release:
runs-on: ubuntu-latest
outputs:
ref: v${{ steps.bump-version.outputs.version }}
version: ${{ steps.bump-version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Extracting version from properties
shell: bash
run: echo "version=$(cat gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT
id: extract-version
- name: Bumping version
uses: TwelveIterationMods/bump-version@v1
with:
version: ${{ steps.extract-version.outputs.version }}
bump: ${{ inputs.bump }}
id: bump-version
- name: Updating version properties
run: |
sed -i "s/^\s*version\s*=.*/version = ${{ steps.bump-version.outputs.version }}/g" gradle.properties
git config user.name "GitHub Actions"
git config user.email "<>"
git commit -am "Set version to ${{ steps.bump-version.outputs.version }}"
git push origin ${BRANCH_NAME}
git tag -a "v${{ steps.bump-version.outputs.version }}" -m "Release ${{ steps.bump-version.outputs.version }}"
git push origin "v${{ steps.bump-version.outputs.version }}"
shell: bash
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
publish-release-api:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
loader: [ common, fabric, forge, neoforge ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ needs.create-release.outputs.ref }}
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Publish API
run: ./gradlew :kuma-api:${{ matrix.loader }}:publish '-Pversion=${{needs.create-release.outputs.version}}' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
needs: create-release
publish-release:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
loader: [ common, fabric, forge, neoforge ]
site: [ curseforge, modrinth, publish ]
exclude:
- loader: common
site: curseforge
- loader: common
site: modrinth
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ needs.create-release.outputs.ref }}
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Publish
run: ./gradlew :kuma:${{ matrix.loader }}:${{ matrix.site }} '-Pversion=${{needs.create-release.outputs.version}}' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
env:
CURSEFORGE_TOKEN: ${{secrets.CURSEFORGE_TOKEN}}
MODRINTH_TOKEN: ${{secrets.MODRINTH_TOKEN}}
needs: create-release
40 changes: 40 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish-snapshot
on:
push:
branches:
- '**'

jobs:
publish-snapshot:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
loader: [common, fabric, forge, neoforge]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup JDK
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Extracting version from properties
shell: bash
run: echo "version=$(cat gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT
id: extract-version
- name: Bumping version
uses: TwelveIterationMods/bump-version@v1
with:
version: ${{ steps.extract-version.outputs.version }}
bump: minor
id: bump-version
- name: Publish API
run: ./gradlew :kuma-api:${{ matrix.loader }}:publish '-Pversion=${{ steps.bump-version.outputs.version }}-SNAPSHOT' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
- name: Publish
run: ./gradlew :kuma:${{ matrix.loader }}:publish '-Pversion=${{ steps.bump-version.outputs.version }}-SNAPSHOT' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}'
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# gradle

.gradle/
build/
out/
classes/

# eclipse

*.launch

# idea

.idea/
*.iml
*.ipr
*.iws

# vscode

.settings/
.vscode/
bin/
.classpath
.project

# macos

*.DS_Store

# fabric

**/runs/**
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Initial Release
10 changes: 10 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
All Rights Reserved

Copyright (c) 2024 BlayTheNinth

For modpack permissions and other exceptions, see https://mods.twelveiterations.com/permissions

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Kuma

Minecraft Mod. Universal Key Modifier API for Fabric, NeoForge and Forge.

`kuma-api` is a library mod intended to be included in existing mods, providing an easy API layer for compatible
key mappings with multi-loader, context and (multi-) modifier support.

`kuma` is a companion mod built upon `kuma-api` that extends the Controls menu with the ability to manage key mappings
that otherwise would not be supported within the given loader, such as key modifiers on Fabric,
multi-modifiers on (Neo)Forge, and custom modifiers (like `Space + Click`).

- [Modpack Permissions](https://mods.twelveiterations.com/permissions)

#### Downloads

[![Versions](http://cf.way2muchnoise.eu/versions/531761_latest.svg)](https://www.curseforge.com/minecraft/mc-mods/kuma)
[![Downloads](http://cf.way2muchnoise.eu/full_531761_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/kuma)

## Adding Kuma to a development environment

### Using Twelve Iterations Maven (includes snapshot versions)

Add the following to your `build.gradle`:

```groovy
repositories {
maven {
url "https://maven.twelveiterations.com/repository/maven-public/"
content {
includeGroup "net.blay09.mods"
}
}
}
dependencies {
// Replace ${kuma_version} with the version you want to depend on.
// You may also have to change the Minecraft version in the artifact name.
// You can find the latest version for a given Minecraft version at https://maven.twelveiterations.com/service/rest/repository/browse/maven-public/net/blay09/mods/kuma-common/
// Common (mojmap): compileOnly "net.blay09.mods:kuma-api-common:${kuma_version}"
// NeoForge: implementation "net.blay09.mods:kuma-api-neoforge:${kuma_version}"
// Fabric: include modApi("net.blay09.mods:kuma-api-fabric:${kuma_version}")
// Forge: implementation "net.blay09.mods:kuma-api-forge:${kuma_version}"
}
```

## Contributing

If you're interested in contributing to the mod, you can check
out [issues labelled as "help wanted"](https://github.com/TwelveIterationMods/Kuma/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22).

When it comes to new features, it's best to confer with me first to ensure we share the same vision. You can join us
on [Discord](https://discord.gg/VAfZ2Nau6j) if you'd like to talk.

Contributions must be done through pull requests. I will not be able to accept translations, code or other assets
through any other channels.
17 changes: 17 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT' apply(false)
// id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' apply(false) // this causes ForgeGradle to fail in reobf
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" // this is required for VanillaGradle and NeoForge to exist in harmony
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' apply(false)
id 'net.darkhax.curseforgegradle' version '1.1.18' apply(false)
id "com.modrinth.minotaur" version "2.+" apply(false)
}

subprojects {
configurations.all {
resolutionStrategy {
cacheChangingModulesFor 60, 'seconds'
cacheDynamicVersionsFor 60, 'seconds'
}
}
}
3 changes: 3 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id 'groovy-gradle-plugin'
}
Loading

0 comments on commit 23013ed

Please sign in to comment.