Skip to content

Commit

Permalink
Build and publish with GitHub Actions (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt authored Nov 10, 2023
1 parent 9df3aeb commit d1e9174
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 256 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build and test PRs

on:
pull_request:
types:
- synchronize
- opened
- ready_for_review
- reopened
push:
branches:
- 'feature/**'
workflow_dispatch:

jobs:
build:
uses: neoforged/actions/.github/workflows/build-prs.yml@main
with:
java: 17
gradle_tasks: build
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release

on:
push:
branches: [ "main" ]

permissions:
contents: read
statuses: write

jobs:
release:
uses: neoforged/actions/.github/workflows/gradle-publish.yml@main
with:
java: 17
pre_gradle_tasks: ''
gradle_tasks: publish
secrets:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
104 changes: 0 additions & 104 deletions .teamcity/pom.xml

This file was deleted.

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

This file was deleted.

54 changes: 0 additions & 54 deletions Jenkinsfile

This file was deleted.

40 changes: 12 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
plugins {
id 'net.neoforged.gradleutils' version '[2.0.16,3)'
id 'com.github.ben-manes.versions' version '0.39.0'
id 'org.javamodularity.moduleplugin' version '1.8.10'
id 'eclipse'
id 'java-library'
id 'maven-publish'
id 'eclipse'
id 'net.neoforged.gradleutils' version '3.0.0-alpha.4'
id 'com.github.ben-manes.versions' version '0.39.0'
id 'org.javamodularity.moduleplugin' version '1.8.10'
}

group 'cpw.mods'

version = gradleutils.getTagOffsetVersion()
logger.lifecycle("Version: $version")
version = gradleutils.version
logger.lifecycle("Version: {}", version)

repositories {
mavenLocal()
Expand All @@ -30,48 +30,32 @@ java {
}

changelog {
fromTag "0.1"
from '1.1'
}

jar {
manifest {
attributes(
'Specification-Title': 'bootstraplauncher',
'Specification-Vendor': 'neoforged',
'Specification-Vendor': 'mcmodlauncher',
'Specification-Version': '1', // We are version 1 of ourselves
'Implementation-Title': project.name,
'Implementation-Version': "${project.version}+${System.getenv("BUILD_NUMBER")?:0}+${gradleutils.gitInfo.branch}.${gradleutils.gitInfo.abbreviatedId}",
'Implementation-Vendor':'neoforged',
'Implementation-Timestamp': java.time.Instant.now().toString(),
'Implementation-Version': "${project.version}+${gradleutils.gitInfo.branch}.${gradleutils.gitInfo.abbreviatedId}",
'Implementation-Vendor':'mcmodlauncher',
'Git-Commit': gradleutils.gitInfo.abbreviatedId,
'Git-Branch': gradleutils.gitInfo.branch,
'Build-Number': "${System.getenv("BUILD_NUMBER")?:0}",
'Main-Class': 'cpw.mods.bootstraplauncher.BootstrapLauncher'
)
}
}

artifacts {
archives jar
archives sourcesJar
}

publishing {
publications.register('mavenJava', MavenPublication) {
from components.java
pom {
name = 'Bootstrap launcher'
description = 'Allows bootstrapping a modularized environment from a classpath one'
url = 'https://github.com/McModLauncher/bootstraplauncher'
scm {
url = 'https://github.com/McModLauncher/bootstraplauncher'
connection = 'scm:git:[email protected]:McModLauncher/bootstraplauncher.git'
developerConnection = 'scm:git:[email protected]:McModLauncher/bootstraplauncher.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/McModLauncher/bootstraplauncher/issues'
}
pomUtils.githubRepo(it, 'bootstraplauncher', 'McModLauncher')
developers {
developer {
id = 'cpw'
Expand All @@ -81,7 +65,7 @@ publishing {
}
}
repositories {
maven gradleutils.getPublishingForgeMaven()
maven gradleutils.publishingMaven
}
}

Expand Down
10 changes: 1 addition & 9 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.neoforged.net/releases' }
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0'
}

rootProject.name = 'bootstraplauncher'

rootProject.name = 'bootstraplauncher'

0 comments on commit d1e9174

Please sign in to comment.