Skip to content

Commit

Permalink
Add Publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3-M4513R committed Jul 26, 2024
1 parent ce0e0c7 commit d3d9de5
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Server builds

on:
push:
branches:
- '**'
tags:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
create-release:
needs: test
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
#This permission is needed to push a release (and/or tags)
permissions:
contents: write #nessesary for tag creation and release creation
actions: write #nessesary for cache deletion
packages: write #packages write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Java 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/[email protected]
- name: Publish Ketting
run: ./gradlew publish
env:
KETTINGUSERNAME: ${{ secrets.KETTINGUSERNAME }}
KETTINGPASSWORD: ${{ secrets.KETTINGPASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Java 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build
run: ./gradlew setup build kettingJar
49 changes: 49 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.api.publish.maven.MavenPublication

plugins {
id 'eclipse'
id 'idea'
Expand Down Expand Up @@ -32,6 +34,53 @@ publishing {
}
}


publishing {
publications.register('mavenJava', MavenPublication).configure {
from components.java

artifactId = project.name
pom {
name = project.name
description = "A custom Mixin plugin to allow some more customizability"
url = "https://github.com/kettingpowered/KettingMixinExtras"
developers {
// developer {
// id = "justred23"
// name = "JustRed23"
// }
developer {
id = "c0d3m4513r"
name = "C0D3 M4513R"
}
}
scm {
connection = "scm:git:https://github.com/kettingpowered/KettingMixinExtras.git"
url = "https://github.com/kettingpowered/KettingMixinExtras"
}
}
}

repositories {
// maven {
// name = "GitHubPackages"
// url = uri("https://maven.pkg.github.com/kettingpowered/Ketting-1-21-x")
// credentials {
// username = System.getenv("GITHUB_ACTOR")
// password = System.getenv("GITHUB_TOKEN")
// }
// }
maven {
name = 'kettingRepo'
credentials {
username = System.getenv("KETTINGUSERNAME")
password = System.getenv("KETTINGPASSWORD")
}
url = "https://reposilite.c0d3m4513r.com/Ketting/"
}
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

0 comments on commit d3d9de5

Please sign in to comment.