Skip to content

Commit

Permalink
Update bot and plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowdashlabs committed Aug 18, 2024
1 parent cb97cbe commit 461a21a
Show file tree
Hide file tree
Showing 20 changed files with 318 additions and 158 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
64 changes: 64 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Docker Build

on:
release:
types:
- published
push:
tags:
branches:
- main
- dev*

jobs:
docker-build:
name: Build Docker Image
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- name: Wait for checks to succeed
uses: lewagon/wait-on-check-action@master
with:
ref: ${{ github.ref }}
check-name: 'Verify Docker Build'
running-workflow-name: 'Verify'
repo-token: ${{ secrets.GITHUB_TOKEN }}
allowed-conclusions: success
- name: Checkout
uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v3
- name: Login to GitHub Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image
uses: docker/build-push-action@v6
with:
file: bot/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
- name: Tag & Push branch image
uses: docker/build-push-action@v6
with:
file: bot/Dockerfile
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
- name: Tag & Push latest image
if: github.ref_name == 'main'
uses: docker/build-push-action@v6
with:
context: .
file: bot/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ github.repository }}:latest
9 changes: 7 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
name: Verify state

on:
release:
types:
- published
push:
pull_request:
types: [ opened, ready_for_review, synchronize ]

jobs:
build:
runs-on: ubuntu-latest
name: "Verify gradle"

steps:
- uses: actions/checkout@v2.3.4
- name: Set up JDK 17
- uses: gradle/wrapper-validation-action@v3
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17
java-version: 21
- name: Check licence
run: ./gradlew licenseCheck
- name: Build with Gradle
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ buildNumber.properties
*.sqlite
/wait.sh
/conf/
.direnv
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Bot and spigot plugin used for the dev cord plugin jamCreator
Bot and spigot plugin used for the dev cord plugin jam

## Start Arguments for paper
`-Dpluginjam.port`
Expand Down
12 changes: 12 additions & 0 deletions bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gradle:jdk21-alpine as build

COPY . .
RUN gradle clean build --no-daemon

FROM eclipse-temurin:21-alpine as runtime

WORKDIR /app

COPY --from=build /home/gradle/bot/build/libs/bot-*-all.jar bot.jar

ENTRYPOINT ["java", "-Dbot.config=config/config.json", "-Dlog4j.configurationFile=config/log4j2.xml", "-Dcjda.localisation.error.name=false", "-jar" , "bot.jar"]
4 changes: 2 additions & 2 deletions bot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins {
id("com.github.johnrengelman.shadow") version "7.1.2"
alias(libs.plugins.shadow)
java
}

group = "de.chojo"
version = "1.0"
version = "1.0.0"

repositories {
maven("https://eldonexus.de/repository/maven-public")
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ allprojects {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

Expand Down
8 changes: 0 additions & 8 deletions docker/bot.DockerFile

This file was deleted.

2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
bot:
image: game-jam-bot
build:
dockerfile: docker/bot.DockerFile
dockerfile: ../bot/Dockerfile
context: ..
networks:
- plugin-jam
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 461a21a

Please sign in to comment.