File tree Expand file tree Collapse file tree
src/test/java/dev/compactmods/services/test/junit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }}
Original file line number Diff line number Diff line change 1+ var envVersion: String = System .getenv(" VERSION" ) ? : " 9.9.9"
2+ if (envVersion.startsWith(" v" ))
3+ envVersion = envVersion.trimStart(' v' )
4+
15plugins {
26 id(" java" )
7+ id(" maven-publish" )
38}
49
10+ base.archivesName = " services"
511group = " dev.compactmods"
6- version = " 0.0.1 "
12+ version = envVersion
713
814repositories {
915 mavenCentral()
@@ -24,4 +30,22 @@ dependencies {
2430
2531tasks.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}
Original file line number Diff line number Diff line change 1313import java .io .IOException ;
1414import java .nio .file .Path ;
1515import java .util .UUID ;
16- import java .util .function .Supplier ;
1716
1817public class DataManagementTests {
1918
You can’t perform that action at this time.
0 commit comments