Skip to content

Commit d3d9de5

Browse files
committed
Add Publishing
1 parent ce0e0c7 commit d3d9de5

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed

.github/workflows/build.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Server builds
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags:
8+
- '**'
9+
pull_request:
10+
branches:
11+
- '**'
12+
workflow_dispatch:
13+
14+
jobs:
15+
create-release:
16+
needs: test
17+
runs-on: ubuntu-latest
18+
if: github.ref_type == 'tag'
19+
#This permission is needed to push a release (and/or tags)
20+
permissions:
21+
contents: write #nessesary for tag creation and release creation
22+
actions: write #nessesary for cache deletion
23+
packages: write #packages write
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v3
27+
- name: Setup Java 17
28+
uses: actions/setup-java@v3
29+
with:
30+
java-version: '17'
31+
distribution: 'temurin'
32+
- name: Setup Gradle
33+
uses: gradle/gradle-build-action@v2.9.0
34+
- name: Publish Ketting
35+
run: ./gradlew publish
36+
env:
37+
KETTINGUSERNAME: ${{ secrets.KETTINGUSERNAME }}
38+
KETTINGPASSWORD: ${{ secrets.KETTINGPASSWORD }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
42+
build:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v3
47+
- name: Setup Java 17
48+
uses: actions/setup-java@v3
49+
with:
50+
java-version: '17'
51+
distribution: 'temurin'
52+
- name: Validate Gradle wrapper
53+
uses: gradle/wrapper-validation-action@v1
54+
- name: Setup Gradle
55+
uses: gradle/gradle-build-action@v2
56+
- name: Build
57+
run: ./gradlew setup build kettingJar

build.gradle

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.api.publish.maven.MavenPublication
2+
13
plugins {
24
id 'eclipse'
35
id 'idea'
@@ -32,6 +34,53 @@ publishing {
3234
}
3335
}
3436

37+
38+
publishing {
39+
publications.register('mavenJava', MavenPublication).configure {
40+
from components.java
41+
42+
artifactId = project.name
43+
pom {
44+
name = project.name
45+
description = "A custom Mixin plugin to allow some more customizability"
46+
url = "https://github.com/kettingpowered/KettingMixinExtras"
47+
developers {
48+
// developer {
49+
// id = "justred23"
50+
// name = "JustRed23"
51+
// }
52+
developer {
53+
id = "c0d3m4513r"
54+
name = "C0D3 M4513R"
55+
}
56+
}
57+
scm {
58+
connection = "scm:git:https://github.com/kettingpowered/KettingMixinExtras.git"
59+
url = "https://github.com/kettingpowered/KettingMixinExtras"
60+
}
61+
}
62+
}
63+
64+
repositories {
65+
// maven {
66+
// name = "GitHubPackages"
67+
// url = uri("https://maven.pkg.github.com/kettingpowered/Ketting-1-21-x")
68+
// credentials {
69+
// username = System.getenv("GITHUB_ACTOR")
70+
// password = System.getenv("GITHUB_TOKEN")
71+
// }
72+
// }
73+
maven {
74+
name = 'kettingRepo'
75+
credentials {
76+
username = System.getenv("KETTINGUSERNAME")
77+
password = System.getenv("KETTINGPASSWORD")
78+
}
79+
url = "https://reposilite.c0d3m4513r.com/Ketting/"
80+
}
81+
}
82+
}
83+
3584
tasks.withType(JavaCompile).configureEach {
3685
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
3786
}

0 commit comments

Comments
 (0)