diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bcf59cd --- /dev/null +++ b/.github/workflows/build.yml @@ -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/gradle-build-action@v2.9.0 + - 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 \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9f23ec8..dfba001 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import org.gradle.api.publish.maven.MavenPublication + plugins { id 'eclipse' id 'idea' @@ -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 }