Skip to content

Commit

Permalink
Migrate Project
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Jun 24, 2023
1 parent 35befaf commit 069e16d
Show file tree
Hide file tree
Showing 27 changed files with 640 additions and 70 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docker

on:
push:
branches: [ "main" ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}


jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.0.5
with:
cosign-release: 'v1.13.1'
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2.5.0
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4.4.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
COSIGN_EXPERIMENTAL: "true"
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}
58 changes: 58 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
.idea/artifacts/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

**/.test-env

# Windows app
wix311/
local.properties
# iOS App
.externalNativeBuild
.cxx
app/ios/Podfile.lock
app/ios/Pods/*
app/ios/iosApp.xcworkspace/*
app/ios/iosApp.xcodeproj/*
!app/ios/iosApp.xcodeproj/project.pbxproj
app/ios/ios.podspec
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM gradle:jdk18 as builder
FROM gradle:jdk19 as builder
WORKDIR /usr/app
COPY . .
RUN gradle --no-daemon :votebot:plugin:installVoteBotArchive
RUN gradle --no-daemon :plugin:installBot

FROM ibm-semeru-runtimes:open-18-jre-focal
FROM ibm-semeru-runtimes:open-19-jre-focal

LABEL org.opencontainers.image.source = "https://github.com/DRSchlaubi/mikbot"

WORKDIR /usr/app
COPY --from=builder /usr/app/votebot/plugin/build/installVoteBot .
COPY --from=builder /usr/app/plugin/build/installVoteBot .

ENTRYPOINT ["/usr/app/bin/mikmusic"]
21 changes: 16 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension

plugins {
`mikbot-bot`
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.kotlin.serialization) apply false
}
allprojects {
version = "5.1.0"
group = "space.votebot"

val versionString = "3.24.0" // version marker

version = versionString
repositories {
mavenCentral()
}
}

subprojects {
version = versionString
afterEvaluate {
configure<KotlinTopLevelExtension> {
jvmToolchain(19)
}
}
}
2 changes: 1 addition & 1 deletion chart-service-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
`mikbot-module`
kotlin("jvm")
kotlin("plugin.serialization")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Request to create a pie chart.@
* Request to create a pie chart.
*
* @property title the title of the pie chart
* @property width the width of the pie chart
Expand Down
8 changes: 1 addition & 7 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ plugins {
kotlin {
explicitApi()

jvm {
compilations.all {
kotlinOptions {
jvmTarget = "18"
}
}
}
jvm()
// js(IR) {
// nodejs()
// browser()
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
systemProp.org.gradle.unsafe.kotlin.assignment=true
23 changes: 23 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[versions]
kotlin = "1.8.22"
mikbot = "3.19.7"
ktor = "2.3.1"

[libraries]
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version = "1.5.1" }
ktor-client-okhttp = { group = "io.ktor", name = "ktor-client-okhttp", version.ref = "ktor" }
ktor-client-content-negotiation = { group = "io.ktor", name = "ktor-client-content-negotiation", version.ref = "ktor" }
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version = "0.4.0" }

mikbot-gdpr = { group = "dev.schlaubi", name = "mikbot-gdpr" }

kordex-processor = { group = "com.kotlindiscord.kord.extensions", name = "annotation-processor", version = "1.5.7-SNAPSHOT" }
java-string-similarity = { group = "info.debatty", name = "java-string-similarity", version = "2.0.0" }

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
mikbot = { id = "dev.schlaubi.mikbot.gradle-plugin", version.ref = "mikbot" }
ksp = { id = "com.google.devtools.ksp", version = "1.8.22-1.0.11" }
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "4.1.1"}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 069e16d

Please sign in to comment.