Skip to content

Commit

Permalink
Switch to actions and publish to central
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Oct 30, 2023
1 parent 9119570 commit e85f991
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 185 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and test PRs

on:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened

jobs:
jdk8:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1000
fetch-tags: true

- name: Setup JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'temurin'

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
push:
branches: [ "main" ]

permissions:
contents: read
statuses: write

jobs:
build:
uses: neoforged/actions/.github/workflows/gradle-publish.yml@main
with:
java: 8
pre_gradle_tasks: ':test'
gradle_tasks: ':publish closeAndReleaseSonatypeStagingRepository'
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }}
104 changes: 0 additions & 104 deletions .teamcity/pom.xml

This file was deleted.

71 changes: 0 additions & 71 deletions .teamcity/settings.kts

This file was deleted.

39 changes: 29 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
plugins {
id 'java'
id 'groovy'
id 'signing'
id 'maven-publish'
id 'org.cadixdev.licenser' version '0.6.1'
id 'net.neoforged.gradleutils' version '2.+'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
}

group = 'net.neoforged'
Expand Down Expand Up @@ -68,13 +70,11 @@ dependencies {
tasks.withType(Jar).configureEach {
manifest.attributes([
'Specification-Title' : 'GroovyDSLImprover',
'Specification-Vendor' : 'MinecraftForge',
'Specification-Vendor' : 'neoforged',
'Implementation-Title' : project.name,
'Implementation-Version': project.version,
'Implementation-Vendor' : 'MinecraftForge',
'Git-Commit' : gradleutils.gitInfo.abbreviatedId,
'Git-Branch' : gradleutils.gitInfo.branch,
'Build-Number' : "${System.getenv('BUILD_NUMBER') ?: 0}"
'Implementation-Vendor' : 'neoforged',
'Git-Commit' : gradleutils.gitInfo.abbreviatedId
])
}

Expand All @@ -87,6 +87,16 @@ test {
useJUnitPlatform()
}

nexusPublishing {
repositories {
sonatype {
username.set(System.getenv('SONATYPE_USER') ?: '')
password.set(System.getenv('SONATYPE_PASSWORD') ?: '')
nexusUrl.set(uri('https://s01.oss.sonatype.org/service/local/'))
}
}
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand All @@ -96,15 +106,15 @@ publishing {
pom {
name = 'GroovyDSLImprover'
description = 'Groovy Compiler Plugin to improve building Groovy based DSLs, like those used in Gradle.'
url = 'https://github.com/MinecraftForge/GroovyDSLImprover'
url = 'https://github.com/neoforged/GroovyDSLImprover'
scm {
url = 'https://github.com/MinecraftForge/GroovyDSLImprover'
connection = 'scm:git:git://github.com/MinecraftForge/GroovyDSLImprover.git'
developerConnection = 'scm:git:[email protected]:MinecraftForge/GroovyDSLImprover.git'
url = 'https://github.com/neoforged/GroovyDSLImprover'
connection = 'scm:git:git://github.com/neoforged/GroovyDSLImprover.git'
developerConnection = 'scm:git:[email protected]:neoforged/GroovyDSLImprover.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/MinecraftForge/GroovyDSLImprover/issues'
url = 'https://github.com/neoforged/GroovyDSLImprover/issues'
}

licenses {
Expand All @@ -126,4 +136,13 @@ publishing {
repositories {
maven gradleutils.getPublishingForgeMaven()
}
}

if (System.getenv('GPG_PRIVATE_KEY')) {
signing {
final signingKey = System.getenv('GPG_PRIVATE_KEY') ?: ''
final signingPassword = System.getenv('GPG_KEY_PASSWORD') ?: ''
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}
}

0 comments on commit e85f991

Please sign in to comment.