Skip to content

Commit

Permalink
Move to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Oct 30, 2023
1 parent a3bfdd3 commit 8e495f1
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 177 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:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1000
fetch-tags: true

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

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

on:
push:
branches: [ "main" ]

permissions:
contents: read
statuses: write

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

MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_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.

16 changes: 14 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ plugins {
id 'net.neoforged.gradleutils' version '[2.0.18,3)'
}

changelog {
disableAutomaticPublicationRegistration()
}

allprojects {
apply plugin: 'java-library'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'signing'

apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'org.javamodularity.moduleplugin'
Expand Down Expand Up @@ -55,9 +60,7 @@ subprojects { subProject ->

jar.doFirst {
manifest.attributes(
'Timestamp' : new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Git-Commit' : gradleutils.gitInfo.abbreviatedId,
'Git-Branch' : gradleutils.gitInfo.branch,
'Build-Number': "${subProject.version}",
'Automatic-Module-Name' : "fml_${subProject.name.replace("-", "_")}",
'FMLModType' : subProject.name.startsWith("language") ? 'LANGPROVIDER' : subProject.name == "events" ? 'GAMELIBRARY' : 'LIBRARY',
Expand Down Expand Up @@ -97,6 +100,15 @@ subprojects { subProject ->
}
}

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.maven
}
}

changelog {
fromTag "1.0"
}
Expand Down

0 comments on commit 8e495f1

Please sign in to comment.