Skip to content

Commit 894e458

Browse files
committed
add ci
1 parent 7d701fc commit 894e458

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

.github/workflows/build.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build Release
2+
on:
3+
release:
4+
types: [ created ]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
11+
- name: Set up JDK 17
12+
uses: actions/setup-java@v2
13+
with:
14+
distribution: 'adopt'
15+
java-version: '17'
16+
17+
- name: Grant execute permission for gradlew
18+
run: chmod +x gradlew
19+
20+
- name: Publish
21+
run: ./gradlew publish -Pmvn.user=${{ secrets.MAVEN_USER }} -Pmvn.key=${{ secrets.MAVEN_TOKEN }}
22+
23+
- uses: actions/upload-artifact@v2
24+
with:
25+
name: Artifacts
26+
path: ./build/libs/

.github/workflows/build_snapshot.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build Snapshot
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'feature/**'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Set up JDK 17
15+
uses: actions/setup-java@v3
16+
with:
17+
distribution: 'temurin'
18+
java-version: '17'
19+
cache: 'gradle'
20+
21+
- name: Grant execute permission for gradlew
22+
run: chmod +x gradlew
23+
24+
- name: Publish
25+
run: ./gradlew publish -Pversion_snapshot -Pmvn.user=${{ secrets.MAVEN_USER }} -Pmvn.key=${{ secrets.MAVEN_TOKEN }} -x test
26+
27+
- uses: actions/upload-artifact@v2
28+
with:
29+
name: Snapshot Artifacts
30+
path: ./build/libs/

build.gradle.kts

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import java.net.URI
2+
13
plugins {
24
kotlin("jvm") version "1.9.22"
35
`java-gradle-plugin`
46
`maven-publish`
57
}
68

79
group = "xyz.wagyourtail.unimined.expect-platform"
8-
version = "1.0-SNAPSHOT"
10+
version = if (project.hasProperty("version_snapshot")) project.properties["version"] as String + "-SNAPSHOT" else project.properties["version"] as String
911

1012
base {
1113
archivesName.set("expect-platform")
@@ -19,6 +21,10 @@ java {
1921

2022
withJavadocJar()
2123
withSourcesJar()
24+
25+
toolchain {
26+
languageVersion.set(JavaLanguageVersion.of(8))
27+
}
2228
}
2329

2430
repositories {
@@ -76,6 +82,20 @@ gradlePlugin {
7682
}
7783

7884
publishing {
85+
repositories {
86+
maven {
87+
name = "WagYourMaven"
88+
url = if (project.hasProperty("version_snapshot")) {
89+
URI.create("https://maven.wagyourtail.xyz/snapshots/")
90+
} else {
91+
URI.create("https://maven.wagyourtail.xyz/releases/")
92+
}
93+
credentials {
94+
username = project.findProperty("mvn.user") as String? ?: System.getenv("USERNAME")
95+
password = project.findProperty("mvn.key") as String? ?: System.getenv("TOKEN")
96+
}
97+
}
98+
}
7999
publications {
80100
create<MavenPublication>("mavenJava") {
81101
groupId = "xyz.wagyourtail.unimined.expect-platform"

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
kotlin.code.style=official
22

3+
version = 1.0.0
4+
35
asmVersion=9.7

0 commit comments

Comments
 (0)