Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,18 @@ jobs:
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Build with Gradle
run: ./gradlew build --parallel --no-daemon

- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
Expand All @@ -42,7 +52,7 @@ jobs:
run: ssh-keyscan -p ${{ secrets.PORT }} -H ${{ secrets.HOST }} >> ~/.ssh/known_hosts

- name: Deploy with rsync
run: rsync -avz /home/runner/work/Radio/Radio/target/radio-1.0-SNAPSHOT.jar ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/opt/dockerfiles/radio
run: rsync -avz /home/runner/work/Radio/Radio/build/libs/ ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/opt/dockerfiles/radio

- name: Rebuild container
uses: appleboy/ssh-action@v1.0.3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ target/
out/
.idea/
logs/
.gradle/
build/

### Security ###
.env
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This repository uses the default SPLAYFUNITY MongoDB database.
Deployment is accessing varios open source ressources and interfaces.

- Github Actions
- Maven shade plugin
- Gradle Build
- ssh
- rsync
- docker compose
68 changes: 68 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/

plugins {
id 'java-library'
id 'maven-publish'
}

group = 'de.splayfer'
version = '1.0.0'

jar {
manifest {
attributes 'Main-Class': 'de.splayfer.Radio'
}
// optional: um sicherzugehen, dass du auch compiled class files bekommst
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

repositories {
mavenLocal()
maven {
url = uri('https://jitpack.io')
}

maven {
url = uri('https://maven.lavalink.dev/releases')
}

maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}

dependencies {
api libs.net.dv8tion.jda
api libs.org.mongodb.mongodb.driver.sync
api libs.dev.arbjerg.lavaplayer
api libs.dev.lavalink.youtube.common
}

group = 'de.splayfer'
version = '1.0-SNAPSHOT'
description = 'radio'
java.sourceCompatibility = JavaVersion.VERSION_21

publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

tasks.withType(Javadoc) {
options.encoding = 'UTF-8'
}
7 changes: 7 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties

org.gradle.configuration-cache=true
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.daemon=true
14 changes: 14 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
dev-arbjerg-lavaplayer = "2.1.2"
dev-lavalink-youtube-common = "1.3.0"
net-dv8tion-jda = "5.0.0-beta.18"
org-mongodb-mongodb-driver-sync = "4.11.1"

[libraries]
dev-arbjerg-lavaplayer = { module = "dev.arbjerg:lavaplayer", version.ref = "dev-arbjerg-lavaplayer" }
dev-lavalink-youtube-common = { module = "dev.lavalink.youtube:common", version.ref = "dev-lavalink-youtube-common" }
net-dv8tion-jda = { module = "net.dv8tion:JDA", version.ref = "net-dv8tion-jda" }
org-mongodb-mongodb-driver-sync = { module = "org.mongodb:mongodb-driver-sync", version.ref = "org-mongodb-mongodb-driver-sync" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading