-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(build): streamline gradle properties and workflow configs
Refactor the gradle.properties file to introduce the mod id, name, and version labelsfor better project versioning control. Adjust the CI workflow configurations to use thesenew labels, ensuring consistency across the project. Additionally, update the fabric.mod.json to reference the new mod version variable. These changes aim to standardize version management and simplify future updates.
- Loading branch information
Showing
85 changed files
with
654 additions
and
506 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: 'Build PR' | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- synchronize | ||
- opened | ||
- ready_for_review | ||
- reopened | ||
|
||
push: | ||
branches: | ||
- '*/**' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: 'Build PR' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
loader: [ 'Forge', 'Fabric' ] | ||
|
||
steps: | ||
- name: 'Checkout repository' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
fetch-tags: true | ||
|
||
- name: 'Set up JDK 17' | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: 'Build ${{ matrix.loader }} with Gradle' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: :${{ matrix.loader }}:build | ||
cache-read-only: false | ||
|
||
- name: 'Upload ${{ matrix.loader }} artifacts' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
name: 'Artifacts-${{ matrix.loader }}' | ||
path: ${{ matrix.loader }}/build/libs/*.jar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: 'Build' | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
branches: | ||
- 'multi/*' | ||
|
||
permissions: | ||
contents: read | ||
statuses: write | ||
|
||
jobs: | ||
build: | ||
name: 'Build' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
loader: [ 'Forge', 'Fabric' ] | ||
|
||
steps: | ||
- name: 'Checkout repository' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
fetch-tags: true | ||
|
||
- name: 'Set up JDK 17' | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: 'Build ${{ matrix.loader }} with Gradle' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: :${{ matrix.loader }}:build | ||
cache-read-only: false | ||
|
||
- name: 'Upload ${{ matrix.loader }} artifacts' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
name: 'Artifacts-${{ matrix.loader }}' | ||
path: ${{ matrix.loader }}/build/libs/*.jar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: 'Publish' | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
label: | ||
type: choice | ||
description: 'Version label' | ||
options: | ||
- -beta | ||
- -alpha | ||
default: '' | ||
required: false | ||
|
||
permissions: | ||
contents: write | ||
statuses: write | ||
|
||
jobs: | ||
build: | ||
name: 'Build' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
loader: [ 'Forge', 'Fabric' ] | ||
|
||
steps: | ||
- name: 'Checkout repository' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
fetch-tags: true | ||
|
||
- name: 'Set up JDK 17' | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: 'Build ${{ matrix.loader }} with Gradle' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: :${{ matrix.loader }}:build | ||
cache-read-only: false | ||
|
||
- name: 'Upload ${{ matrix.loader }} artifacts' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
if-no-files-found: error | ||
name: 'Artifacts-${{ matrix.loader }}' | ||
path: ${{ matrix.loader }}/build/libs/*.jar | ||
|
||
publish: | ||
name: 'Publish' | ||
runs-on: ubuntu-latest | ||
|
||
needs: [build] | ||
|
||
continue-on-error: true | ||
|
||
steps: | ||
- name: 'Checkout repository' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
fetch-tags: true | ||
|
||
- name: 'Set up JDK 17' | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: 'Publish with Gradle' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: publishMod | ||
cache-read-only: false | ||
env: | ||
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
|
||
release: | ||
name: 'Create release' | ||
runs-on: ubuntu-latest | ||
|
||
needs: [build, publish] | ||
|
||
continue-on-error: true | ||
|
||
steps: | ||
- name: 'Checkout repository' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
fetch-tags: true | ||
|
||
- name: 'Get latest tag' | ||
id: latest-tag | ||
uses: WyriHaximus/github-action-get-previous-tag@v1 | ||
with: | ||
fallback: '0.0.0.0' | ||
|
||
- name: 'Download ${{ matrix.loader }} artifacts' | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: 'Artifacts-*' | ||
path: artifacts/ | ||
merge-multiple: true | ||
|
||
- name: 'Create release' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: "${{ github.event.repository.name }}-${{ github.ref_name }}-${{ steps.latest-tag.outputs.tag }}${{ inputs.label }}" | ||
tag_name: ${{ steps.latest-tag.outputs.tag }} | ||
target_commitish: ${{ github.ref }} | ||
body_path: CHANGELOG.md | ||
files: | | ||
'artifacts/*' | ||
'!artifacts/*-slim.*' |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apply plugin: 'org.spongepowered.gradle.vanilla' | ||
|
||
println "Using Minecraft: $minecraft_version" | ||
|
||
minecraft { | ||
version minecraft_version | ||
if(file("src/main/resources/${mod_id}.accesswidener").exists()) { | ||
accessWideners file("src/main/resources/${mod_id}.accesswidener") | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() { | ||
content { | ||
includeGroup 'org.projectlombok' | ||
} | ||
} | ||
maven { url 'https://maven.nova-committee.cn/releases' } | ||
} | ||
|
||
dependencies { | ||
implementation ("org.spongepowered:mixin:0.8.5") | ||
compileOnly ("org.projectlombok:lombok:$lombok_version") | ||
annotationProcessor ("org.projectlombok:lombok:$lombok_version") | ||
implementation ("cn.evole.onebot:OneBot-Client:$onebot_client_version"){transitive = false} | ||
implementation ("org.spongepowered:configurate-yaml:$yaml_version") | ||
implementation("com.github.houbb:csv:0.2.0") | ||
implementation ("com.google.code.findbugs:jsr305:3.0.1") | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.