Skip to content

Commit 365270e

Browse files
committed
Code coverage and first release
1 parent d01bbf1 commit 365270e

3 files changed

Lines changed: 52 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish
2+
3+
on: push
4+
5+
jobs:
6+
publish:
7+
name: Publish Code as Github Package - ${{ inputs.version }}
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v6
12+
13+
- name: Set up JDK
14+
uses: actions/setup-java@v5
15+
with:
16+
distribution: temurin
17+
java-version: 25
18+
19+
- name: Setup Gradle
20+
uses: gradle/actions/setup-gradle@v5
21+
22+
- name: Publish
23+
run: ./gradlew :publish
24+
env:
25+
VERSION: ${{ inputs.version }}
26+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle.kts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
var envVersion: String = System.getenv("VERSION") ?: "9.9.9"
2+
if (envVersion.startsWith("v"))
3+
envVersion = envVersion.trimStart('v')
4+
15
plugins {
26
id("java")
7+
id("maven-publish")
38
}
49

10+
base.archivesName = "services"
511
group = "dev.compactmods"
6-
version = "0.0.1"
12+
version = envVersion
713

814
repositories {
915
mavenCentral()
@@ -24,4 +30,22 @@ dependencies {
2430

2531
tasks.test {
2632
useJUnitPlatform()
33+
}
34+
35+
val PACKAGES_URL = System.getenv("GH_PKG_URL") ?: "https://maven.pkg.github.com/compactmods/services"
36+
publishing {
37+
publications.register<MavenPublication>("main") {
38+
from(components.getByName("java"))
39+
}
40+
41+
repositories {
42+
// GitHub Packages
43+
maven(PACKAGES_URL) {
44+
name = "GitHubPackages"
45+
credentials {
46+
username = System.getenv("GITHUB_ACTOR")
47+
password = System.getenv("GITHUB_TOKEN")
48+
}
49+
}
50+
}
2751
}

src/test/java/dev/compactmods/services/test/junit/DataManagementTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.io.IOException;
1414
import java.nio.file.Path;
1515
import java.util.UUID;
16-
import java.util.function.Supplier;
1716

1817
public class DataManagementTests {
1918

0 commit comments

Comments
 (0)