From 0eb30bde31a01e828416f71908f378ed6250a293 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Wed, 24 Jul 2024 14:32:47 +0200 Subject: [PATCH] Add publishing --- .github/workflows/build.yaml | 82 +++++++++++++++++++++++++++++++++++ .github/workflows/support.yml | 27 ------------ build.gradle | 30 ++++++++++--- settings.gradle | 1 + 4 files changed, 107 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/build.yaml delete mode 100644 .github/workflows/support.yml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..d733be97d --- /dev/null +++ b/.github/workflows/build.yaml @@ -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/gradle-build-action@v2.9.0 + 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 }} diff --git a/.github/workflows/support.yml b/.github/workflows/support.yml deleted file mode 100644 index 83fb7e519..000000000 --- a/.github/workflows/support.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Support Requests - -on: - issues: - types: - - labeled - - unlabeled - - reopened - -permissions: - issues: write - -jobs: - support: - runs-on: ubuntu-latest - steps: - - uses: dessant/support-requests@v2 - with: - support-label: forum - issue-comment: > - :wave: We use the issue tracker exclusively for final bug reports and feature requests. - However, this issue appears to be better suited for the - [Forge Support Forums](https://forums.minecraftforge.net/) or - [Forge Discord](https://discord.gg/UvedJ9m). Please create a new topic on the support forum - with this issue or ask in the `#tech-support` channel in the Discord server, and the - conversation can continue there. - lock-issue: true \ No newline at end of file diff --git a/build.gradle b/build.gradle index 625dbd9f1..eae362823 100644 --- a/build.gradle +++ b/build.gradle @@ -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 @@ -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' } } @@ -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/" + } } } diff --git a/settings.gradle b/settings.gradle index a285031a0..0e7131669 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,6 +2,7 @@ pluginManagement { repositories { gradlePluginPortal() maven { url = 'https://maven.minecraftforge.net/' } + maven { url = 'https://reposilite.c0d3m4513r.com/Ketting/' } } }