Skip to content

Commit 394e463

Browse files
added GitHub workflows
1 parent e66f12d commit 394e463

File tree

4 files changed

+64
-55
lines changed

4 files changed

+64
-55
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
fetch-tags: true
14+
15+
- name: Setup JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '21'
19+
distribution: 'temurin'
20+
21+
- name: Make Gradle wrapper executable
22+
run: chmod +x ./gradlew
23+
24+
- name: Setup Gradle
25+
uses: gradle/actions/setup-gradle@v4
26+
27+
- name: Build with Gradle
28+
run: ./gradlew build -x test

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Only run on version tags like v1.0.0
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
fetch-tags: true
17+
18+
- name: Setup JDK 21
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '21'
22+
distribution: 'temurin'
23+
24+
- name: Make Gradle wrapper executable
25+
run: chmod +x ./gradlew
26+
27+
- name: Build
28+
run: ./gradlew build
29+
30+
- name: Upload JAR to GitHub Release
31+
uses: softprops/action-gh-release@v2
32+
with:
33+
files: build/libs/*.jar

build.gradle

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def loadEnv() {
2727
}
2828
}
2929
loadEnv()
30-
version = mod_version
30+
version = minecraft_version + "-" + mod_version
3131
group = mod_group_id
3232

3333
base {
@@ -200,7 +200,7 @@ tasks.named('jar', Jar).configure {
200200
attributes([
201201
'Specification-Title' : mod_id,
202202
'Specification-Vendor' : mod_authors,
203-
'Specification-Version' : '1.20.1 1.0', // We are version 1 of ourselves
203+
'Specification-Version' : '1.21.1 1.3', // We are version 1 of ourselves
204204
'Implementation-Title' : project.name,
205205
'Implementation-Version' : project.jar.archiveVersion,
206206
'Implementation-Vendor' : mod_authors,
@@ -230,59 +230,7 @@ publishing {
230230
}
231231
}
232232

233-
//the jreleaser doesn't work
234-
//todo find why and fix it
235-
jreleaser {
236-
project {
237-
name = 'FormicAPI'
238-
version = mod_version
239-
description = 'A Minecraft modding API for the Engineer Colony'
240-
authors = ['RealAntEngineer']
241-
license = 'MIT'
242-
// Project homepage
243-
java {
244-
version = '17'
245-
}
246-
website = 'https://github.com/RealAntEngineer/FormicAPI'
247-
}
248233

249-
deploy {
250-
maven {
251-
mavenCentral {
252-
main {
253-
active = 'ALWAYS'
254-
url = 'https://s01.oss.sonatype.org/services/staging/deploy/maven2/' // new token-based endpoint
255-
256-
username = System.getProperty('SONATYPE_USERNAME')
257-
password = System.getProperty('SONATYPE_TOKEN')
258-
}
259-
}
260-
}
261-
}
262-
signing {
263-
//active = 'ALWAYS'
264-
//armored = true
265-
//mode = 'MEMORY'
266-
secretKey = System.getProperty('SONATYPE_USERNAME')
267-
passphrase = System.getProperty('SONATYPE_TOKEN')
268-
}
269-
270-
distributions {
271-
main {
272-
artifact {
273-
path = "$buildDir/libs/formic-api-${minecraft_version}.jar"
274-
}
275-
extraProperties.put('groupId', 'io.github.realantengineer.formicapi')
276-
extraProperties.put('artifactId', "formic-api-${minecraft_version}")
277-
extraProperties.put('version', mod_version)
278-
}
279-
}
280-
/*release {
281-
github {
282-
active = 'NEVER'
283-
}
284-
}*/
285-
}
286234
tasks.withType(JavaCompile).configureEach {
287235
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
288236
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod_id=formicapi
2828
mod_name=Formic API
2929
mod_license=MIT
3030

31-
mod_version=1.2
31+
mod_version=1.3
3232

3333
create_version = 6.0.4-55
3434
flywheel_version = 1.0.2

0 commit comments

Comments
 (0)