Skip to content

Commit

Permalink
feat: Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveplays28 committed Jul 16, 2024
0 parents commit 7948b0d
Show file tree
Hide file tree
Showing 90 changed files with 5,669 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ko_fi: Steveplays
patreon: Steveplays28
58 changes: 58 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Java CI

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
skip_duplicate_jobs:
name: Skip duplicate jobs
continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
paths_ignore: '["**/README.md", "**/docs/**", "**/.gitignore", "**/LICENSE"]'
concurrent_skipping: same_content_newer

run_tests_and_build:
name: Run tests and build
runs-on: ubuntu-latest
needs: skip_duplicate_jobs
if: needs.skip_duplicate_jobs.outputs.should_skip != 'true'

steps:
- uses: actions/checkout@v3

- name: Setup JDK (Temurin 17)
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew

- name: Execute Gradle build
run: ./gradlew build

- name: Upload Gradle artifacts
uses: actions/upload-artifact@v4
with:
name: compiled_jar_files
path: "**/build/libs/"
101 changes: 101 additions & 0 deletions .github/workflows/publish-curseforge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Publish (CurseForge)

on:
workflow_dispatch:

jobs:
build_and_publish:
name: Build and publish
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v3

- name: Get mod version from Gradle
uses: madhead/read-java-properties@latest
id: mod_version
with:
file: gradle.properties
property: mod_version
default: 0.0.1

- name: Get supported Minecraft version from Gradle
uses: madhead/read-java-properties@latest
id: supported_minecraft_version_name
with:
file: gradle.properties
property: supported_minecraft_version_name
default: 0.0.1

- name: Print version string
run: echo version string ${{ steps.mod_version.outputs.value }}+mc${{ steps.supported_minecraft_version_name.outputs.value }}

- name: Set release tag name environment variable
run: echo release_tag_name=v${{ steps.mod_version.outputs.value }}+mc${{ steps.supported_minecraft_version_name.outputs.value }} >> $GITHUB_ENV

- name: Get existing release
uses: cardinalby/git-get-release-action@v1
id: get_existing_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.release_tag_name }}
doNotFailIfNotFound: true

- name: Check if an existing release with the same version exists
if: steps.get_existing_release.outputs.tag_name == env.release_tag_name
run: exit 1

- name: Setup JDK (Temurin 17)
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew

- name: Execute Gradle build
run: ./gradlew build

# https://github.com/marketplace/actions/mc-publish
- name: Publish mod (Fabric)
uses: Kir-Antipov/[email protected]
with:
# CurseForge
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

name: ${{ steps.mod_version.outputs.value }} (${{ steps.supported_minecraft_version_name.outputs.value }})
github-tag: ${{ env.release_tag_name }}
files: |
fabric/build/libs/!(*-@(sources|dev-shadow|javadoc|transformProduction*).jar)
fabric/build/libs/*-@(sources|javadoc).jar
version-type: release
modrinth-featured: false
changelog-file: CHANGELOG_LATEST.md

# https://github.com/marketplace/actions/mc-publish
- name: Publish mod (NeoForge/Forge)
uses: Kir-Antipov/[email protected]
with:
# CurseForge
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

name: ${{ steps.mod_version.outputs.value }} (${{ steps.supported_minecraft_version_name.outputs.value }})
github-tag: ${{ env.release_tag_name }}
files: |
forge/build/libs/!(*-@(sources|dev-shadow|javadoc|transformProduction*).jar)
forge/build/libs/*-@(sources|javadoc).jar
version-type: release
modrinth-featured: false
changelog-file: CHANGELOG_LATEST.md
77 changes: 77 additions & 0 deletions .github/workflows/publish-github-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish (GitHub releases)

on:
workflow_dispatch:

jobs:
build_and_publish:
name: Build and publish
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v3

- name: Get mod version from Gradle
uses: madhead/read-java-properties@latest
id: mod_version
with:
file: gradle.properties
property: mod_version
default: 0.0.1

- name: Get supported Minecraft version from Gradle
uses: madhead/read-java-properties@latest
id: supported_minecraft_version_name
with:
file: gradle.properties
property: supported_minecraft_version_name
default: 0.0.1

- name: Print version string
run: echo version string ${{ steps.mod_version.outputs.value }}+mc${{ steps.supported_minecraft_version_name.outputs.value }}

- name: Set release tag name environment variable
run: echo release_tag_name=v${{ steps.mod_version.outputs.value }}+mc${{ steps.supported_minecraft_version_name.outputs.value }} >> $GITHUB_ENV

- name: Get existing release
uses: cardinalby/git-get-release-action@v1
id: get_existing_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.release_tag_name }}
doNotFailIfNotFound: true

- name: Check if an existing release with the same version exists
if: steps.get_existing_release.outputs.tag_name == env.release_tag_name
run: exit 1

- name: Setup JDK (Temurin 17)
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew

- name: Execute Gradle build
run: ./gradlew build

- name: Publish mod to GitHub releases
uses: ncipollo/[email protected]
with:
name: ${{ steps.mod_version.outputs.value }} (${{ steps.supported_minecraft_version_name.outputs.value }})
tag: ${{ env.release_tag_name }}
artifacts: "**/build/libs/!(*-@(dev-shadow|transformProduction*).jar)"
bodyFile: CHANGELOG_LATEST.md
74 changes: 74 additions & 0 deletions .github/workflows/publish-maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Publish (Maven)

on:
workflow_dispatch:

jobs:
build_and_publish:
name: Build and publish
runs-on: ubuntu-latest
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v3

- name: Get mod version from Gradle
uses: madhead/read-java-properties@latest
id: mod_version
with:
file: gradle.properties
property: mod_version
default: 0.0.1

- name: Get supported Minecraft version from Gradle
uses: madhead/read-java-properties@latest
id: supported_minecraft_version_name
with:
file: gradle.properties
property: supported_minecraft_version_name
default: 0.0.1

- name: Print version string
run: echo version string ${{ steps.mod_version.outputs.value }}+mc${{ steps.supported_minecraft_version_name.outputs.value }}

- name: Set release tag name environment variable
run: echo release_tag_name=v${{ steps.mod_version.outputs.value }}+mc${{ steps.supported_minecraft_version_name.outputs.value }} >> $GITHUB_ENV

- name: Get existing release
uses: cardinalby/git-get-release-action@v1
id: get_existing_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.release_tag_name }}
doNotFailIfNotFound: true

- name: Check if an existing release with the same version exists
if: steps.get_existing_release.outputs.tag_name == env.release_tag_name
run: exit 1

- name: Setup JDK (Temurin 17)
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Change Gradle wrapper permissions
run: chmod +x ./gradlew

- name: Execute Gradle build
run: ./gradlew build

- name: Publish mod to Maven repository
run: ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 7948b0d

Please sign in to comment.