Skip to content

Commit

Permalink
Publish to plugin portal
Browse files Browse the repository at this point in the history
  • Loading branch information
LexManos committed Nov 15, 2023
1 parent 0b61648 commit 9400f1a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 54 deletions.
47 changes: 22 additions & 25 deletions .github/workflows/gradle_publish_on_push.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
name: Main Publish
name: Publish

on:
push:
branches:
- '**'
- '!**-noci'
branches: [ "master" ]

permissions:
contents: read

jobs:
build-and-publish:
runs-on: ubuntu-latest
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
SIGN_KEYSTORE_PASSWORD: ${{ secrets.SIGN_KEYSTORE_PASSWORD }}
SIGN_KEYSTORE_DATA: ${{ secrets.SIGN_KEYSTORE_DATA }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'
cache: gradle
- name: Build and Publish
run: ./gradlew publish --stacktrace --no-daemon
build:
uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@main
with:
java: 8
gradle_tasks: "publish publishPlugins"
artifact_name: "gradlejarsigner"
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
PROMOTE_ARTIFACT_WEBHOOK: ${{ secrets.PROMOTE_ARTIFACT_WEBHOOK }}
PROMOTE_ARTIFACT_USERNAME: ${{ secrets.PROMOTE_ARTIFACT_USERNAME }}
PROMOTE_ARTIFACT_PASSWORD: ${{ secrets.PROMOTE_ARTIFACT_PASSWORD }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
57 changes: 28 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ plugins {
id 'java'
id 'java-gradle-plugin'
id 'eclipse'
id 'net.minecraftforge.gradleutils' version '2.0.11'
id 'net.minecraftforge.gradleutils' version '2.2.0'
id 'com.gradle.plugin-publish' version '1.2.1'
}

repositories {
Expand All @@ -17,18 +18,22 @@ java.withSourcesJar()

license {
header project.file('LICENSE-header.txt')
include 'net/minecraftforge/**/*.java'
newLine false
}

version = gradleutils.tagOffsetVersion
println('Version: ' + version)

gradlePlugin {
website = 'https://github.com/MinecraftForge/GradleJarSigner'
vcsUrl = 'https://github.com/MinecraftForge/GradleJarSigner.git'
plugins {
gradlejarsigner {
id = 'net.minecraftforge.gradlejarsigner'
implementationClass = 'net.minecraftforge.gradlejarsigner.GradleJarSignerPlugin'
displayName = 'Gradle Jar Signer'
description = 'Wrapper for Ant signjar, allowing proper task caching'
tags.set(['signing', 'java', 'signjar'])
}
}
}
Expand All @@ -43,41 +48,35 @@ compileJava {
jar {
manifest {
attributes([
'Specification-Title': 'GradleJarSigner',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': gradleutils.gitInfo.tag,
'Implementation-Title': 'SimpleGradleJarSigner',
'Implementation-Version': project.version,
'Implementation-Vendor': 'Forge Development LLC'
'Specification-Title': 'GradleJarSigner',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': gradleutils.gitInfo.tag,
'Implementation-Title': 'GradleJarSigner',
'Implementation-Vendor': 'Forge Development LLC',
'Implementation-Version': project.version
] as LinkedHashMap, 'net/minecraftforge/gradlejarsigner/')
}
}

changelog {
fromTag '1.0'
publishAll = false
}

publishing {
publications {
pluginMaven(MavenPublication) {
pom {
packaging = 'jar'
description = 'Gradle Jar Signer Plugin'
url = 'https://github.com/MinecraftForge/GradleJarSigner'
publications.register('pluginMaven', MavenPublication) {
changelog.publish(it)
pom {
packaging = 'jar'
description = 'Gradle Jar Signer Plugin'
url = 'https://github.com/MinecraftForge/GradleJarSigner'

scm {
url = 'https://github.com/MinecraftForge/GradleJarSigner'
connection = 'scm:git:git://github.com/MinecraftForge/GradleJarSigner.git'
developerConnection = 'scm:git:[email protected]:MinecraftForge/GradleJarSigner.git'
}
gradleutils.pom.setGitHubDetails(pom, 'GradleJarSigner')

issueManagement {
system = 'github'
url = 'https://github.com/MinecraftForge/GradleJarSigner/issues'
}
license gradleutils.pom.licenses.LGPLv2_1

developers {
developer {
id = 'LexManos'
name = 'Lex Manos'
}
}
developers {
developer gradleutils.pom.Developers.LexManos
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public void setKeyPass(String value) {
/**
* A base64 encode string containing the keystore data.
* This will be written to a temporary file and then deleted after the task is run.
*
* @param value Base64 encode keystore
*/
public void setKeyStoreData(String value) {
this.keyStoreData = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ public void setKeyPass(String value) {
/**
* A base64 encode string containing the keystore data.
* This will be written to a temporary file and then deleted after the task is run.
*
* @param value Base64 encode keystore
*/
public void setKeyStoreData(String value) {
this.keyStoreData.set(value);
Expand Down

0 comments on commit 9400f1a

Please sign in to comment.