Skip to content

Commit 1a11cdc

Browse files
authored
Merge pull request #89 from dshadowwolf/master-2.0-1.21.1-neo
update to the new build+release system
2 parents 28410a7 + ef64659 commit 1a11cdc

16 files changed

Lines changed: 566 additions & 169 deletions

‎.gitattributes‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Store and check out repository text as LF on every platform. Windows command
2+
# files are the sole exception below.
3+
* text=auto eol=lf
4+
5+
*.bat text eol=crlf
6+
#*.bat text eol=lf
7+
*.gradle text diff=java
8+
mcmod.info text
9+
*.java text
10+
*.json text
11+
*.lang text
12+
*.mcmeta text
13+
*.md text
14+
*.properties text
15+
gradlew text eol=lf
16+
*.sh text eol=lf
17+
*.txt text
18+
*.xml text
19+
*.yml text
20+
*.yaml text
21+
*.toml text
22+
23+
# Documents
24+
*.pdf binary
25+
26+
# Graphics
27+
*.eps binary
28+
*.gif binary
29+
*.ico binary
30+
*.jpg binary
31+
*.jpeg binary
32+
*.png binary
33+
*.psd binary
34+
# SVG treated as an asset (binary) by default. If you want to treat it as text,
35+
# comment-out the following line and uncomment the line after.
36+
*.svg binary
37+
#*.svg text
38+
*.tif binary
39+
*.tiff binary
40+
*.webp binary
41+
*.xcf binary
42+
43+
# Other
44+
*.exe binary
45+
*.jar binary
46+
47+
###############################
48+
# Git Large File System (LFS) #
49+
###############################
50+
51+
# Archives
52+
#*.7z filter=lfs diff=lfs merge=lfs -text
53+
#*.br filter=lfs diff=lfs merge=lfs -text
54+
#*.bz2 filter=lfs diff=lfs merge=lfs -text
55+
#*.gz filter=lfs diff=lfs merge=lfs -text
56+
#*.tar filter=lfs diff=lfs merge=lfs -text
57+
#*.zip filter=lfs diff=lfs merge=lfs -text
58+
59+
# Documents
60+
#*.pdf filter=lfs diff=lfs merge=lfs -text
61+
62+
# Graphics
63+
#*.eps filter=lfs diff=lfs merge=lfs -text
64+
#*.gif filter=lfs diff=lfs merge=lfs -text
65+
#*.ico filter=lfs diff=lfs merge=lfs -text
66+
#*.jpg filter=lfs diff=lfs merge=lfs -text
67+
#*.jpeg filter=lfs diff=lfs merge=lfs -text
68+
#*.png filter=lfs diff=lfs merge=lfs -text
69+
#*.psd filter=lfs diff=lfs merge=lfs -text
70+
#*.tif filter=lfs diff=lfs merge=lfs -text
71+
#*.tiff filter=lfs diff=lfs merge=lfs -text
72+
#*.webp filter=lfs diff=lfs merge=lfs -text
73+
#*.xcf filter=lfs diff=lfs merge=lfs -text
74+
75+
# Other
76+
#*.exe filter=lfs diff=lfs merge=lfs -text
77+
#*.jar filter=lfs diff=lfs merge=lfs -text

‎.github/workflows/build_status.yml‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ '**' ]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: build-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
JAVA_VERSION: 21
17+
18+
jobs:
19+
build:
20+
name: Build and test
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 30
23+
steps:
24+
- name: Check out source
25+
uses: actions/checkout@v7
26+
27+
- name: Validate Gradle Wrapper
28+
uses: gradle/actions/wrapper-validation@v6
29+
30+
- name: Set up JDK ${{ env.JAVA_VERSION }}
31+
uses: actions/setup-java@v6
32+
with:
33+
java-version: ${{ env.JAVA_VERSION }}
34+
distribution: 'microsoft'
35+
36+
- name: Set up Gradle
37+
uses: gradle/actions/setup-gradle@v6
38+
39+
- name: Build and test
40+
run: |
41+
chmod +x ./gradlew
42+
./gradlew clean check build
43+
44+
- name: Upload build artifacts
45+
continue-on-error: true
46+
uses: actions/upload-artifact@v7
47+
with:
48+
name: ${{ github.event.repository.name }}-${{ github.sha }}
49+
if-no-files-found: error
50+
retention-days: 14
51+
path: |
52+
build/libs/*.jar

‎.github/workflows/publish.yml‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Upload Release Artifacts
2+
3+
on:
4+
push:
5+
tags: [ '*' ]
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: publish-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: false # Never cancel a release halfway through uploading.
13+
14+
env:
15+
JAVA_VERSION: 21
16+
# Only booleans here, the secrets themselves are passed to the steps that need them. This is a preventative measure.
17+
HAS_MAVEN: ${{ secrets.MAVEN_UPLOAD_URL != '' }}
18+
HAS_CURSEFORGE: ${{ secrets.CURSEFORGE_TOKEN != '' }}
19+
# The release tag ("modMajor.modMinor.modBug.minecraftVersionNoDots.loader" example: 1.2.1.121012) is used as-is for the mod version, build.gradle reads this.
20+
TAG: ${{ github.ref_name }}
21+
22+
jobs:
23+
publish:
24+
name: Build and Publish
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 30
27+
permissions:
28+
contents: write # Required for mc-publish to create a GitHub release.
29+
30+
steps:
31+
- name: Check out source
32+
uses: actions/checkout@v7
33+
34+
- name: Validate Gradle Wrapper
35+
uses: gradle/actions/wrapper-validation@v6
36+
37+
- name: Set up JDK ${{ env.JAVA_VERSION }}
38+
uses: actions/setup-java@v6
39+
with:
40+
java-version: ${{ env.JAVA_VERSION }}
41+
distribution: 'microsoft'
42+
43+
- name: Set up Gradle
44+
uses: gradle/actions/setup-gradle@v6
45+
46+
- name: Read gradle.properties
47+
run: |
48+
# Keeps the CurseForge ID defined in one place.
49+
prop() { grep -E "^$1\s*=" gradle.properties | cut -d= -f2- | tr -d '[:space:]'; }
50+
echo "CURSEFORGE_ID=$(prop curseforge_id)" >> "$GITHUB_ENV"
51+
52+
- name: Build and test
53+
run: |
54+
chmod +x ./gradlew
55+
./gradlew clean check build
56+
57+
- name: Publish to Maven
58+
if: env.HAS_MAVEN == 'true'
59+
run: ./gradlew publish
60+
env:
61+
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
62+
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
63+
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
64+
65+
# For additional properties and values that are not detected/set up here, you can read up on the docs here:
66+
# https://github.com/Kira-NT/mc-publish
67+
# I HEAVILY advise you read about this action, as this action can do a lot but also has a few quirks like changelog publishing not working right.
68+
- name: Publish to GitHub
69+
uses: Kira-NT/mc-publish@v3.3.2
70+
with:
71+
github-token: ${{ github.token }}
72+
version: ${{ env.TAG }}
73+
# Main jar first so it becomes the primary file, sources/javadoc attached as extras.
74+
files: |
75+
build/libs/!(*-@(sources|javadoc)).jar
76+
build/libs/*-@(sources|javadoc).jar
77+
78+
- name: Publish to CurseForge
79+
if: env.HAS_CURSEFORGE == 'true' && env.CURSEFORGE_ID != ''
80+
uses: Kira-NT/mc-publish@v3.3.2
81+
with:
82+
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
83+
# Read from curseforge_id in gradle.properties.
84+
curseforge-id: ${{ env.CURSEFORGE_ID }}
85+
version: ${{ env.TAG }}
86+
files: |
87+
build/libs/!(*-@(sources|javadoc)).jar
88+
build/libs/*-@(sources|javadoc).jar
89+
loaders: |
90+
neoforge
91+
environment: client | server
92+
java: ${{ env.JAVA_VERSION }}

‎.gitignore‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
/.gradle/
44
/debugmods/
55
/.idea/
6-
/gradle/
76
/bin/
87
/.vscode/
98
/logs/
109

1110
# Local tools (google-java-format for ./gradlew format)
1211
/tools/*.jar
12+
13+
# Eclipse (generated by ./gradlew eclipse)
14+
/.classpath
15+
/.project
16+
/.settings/
17+
/*.launch
18+
19+
# Local Maven repository (publishAllPublicationsToLocalRepository)
20+
/mcmodsrepo/
21+
/.eclipse/

0 commit comments

Comments
 (0)