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 24, 2024
1 parent 0e4f4fd commit 0eb30bd
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 33 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Server builds

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- run: git fetch -a
- name: Setup Java 8
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
# - name: Cache .gradle
# uses: burrunan/gradle-cache-action@v1
# with:
# # Enable concurrent cache save and restore
# # Default is concurrent=false for better log readability
# concurrent: true
# # Disable caching of $HOME/.gradle/caches/*.*/generated-gradle-jars
# save-generated-gradle-jars: false
# # Disable publishing Gradle Build Scan URL to job report #Don't
# gradle-build-scan-report: true
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build
run: ./gradlew build

release:
needs: build
runs-on: ubuntu-latest
if: github.ref_type == 'tag'
permissions:
contents: write
packages: write

steps:
- uses: actions/checkout@v3
- name: Get Version Name
id: version_name
run: |
echo version=${GITHUB_REF#refs/tags/v} >> $GITHUB_OUTPUT
- run: git fetch -a
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle
uses: gradle/[email protected]
with:
arguments: publish
env:
KETTINGUSERNAME: ${{ secrets.KETTINGUSERNAME }}
KETTINGPASSWORD: ${{ secrets.KETTINGPASSWORD }}
VERSION: ${{ steps.version_name.outputs.version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
run: |
gh release create "v$VERSION" build/libs/mixingradle-$VERSION.jar build/libs/mixingradle-$VERSION-groovydoc.jar \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} v$VERSION" \
--generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version_name.outputs.version }}
27 changes: 0 additions & 27 deletions .github/workflows/support.yml

This file was deleted.

30 changes: 24 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ plugins {
id 'com.github.ben-manes.versions' version '0.46.0'
}

version = gradleutils.getTagOffsetBranchVersion('FG_6.0')
group = 'org.kettingpowered.patched.minecraftforge'
version = System.getenv("VERSION")
logger.lifecycle('Version: ' + version + ' Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))

/*
changelog {
from '6.0'
publishAll = false
}
*/
sourceSets {
common
mcp
Expand Down Expand Up @@ -97,15 +100,15 @@ dependencies {
gradlePlugin {
plugins {
mcp {
id = 'net.minecraftforge.gradle.mcp'
id = group + '.gradle.mcp'
implementationClass = 'net.minecraftforge.gradle.mcp.MCPPlugin'
}
patcher {
id = 'net.minecraftforge.gradle.patcher'
id = group + '.gradle.patcher'
implementationClass = 'net.minecraftforge.gradle.patcher.PatcherPlugin'
}
userdev {
id = 'net.minecraftforge.gradle'
id = group + '.gradle'
implementationClass = 'net.minecraftforge.gradle.userdev.UserDevPlugin'
}
}
Expand All @@ -117,10 +120,25 @@ publishing {
pluginMaven(MavenPublication) {
// Automated publishing declares the java component for us

project.changelog.publish(it)
// project.changelog.publish(it)
}
}
repositories {
maven gradleutils.getPublishingForgeMaven()
// maven {
// name = "GitHubPackages"
// url = uri("https://maven.pkg.github.com/kettingpowered/ForgeGradle")
// 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/"
}
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
maven { url = 'https://reposilite.c0d3m4513r.com/Ketting/' }
}
}

Expand Down

0 comments on commit 0eb30bd

Please sign in to comment.