Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
ci: releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
AH-dark committed Dec 7, 2023
1 parent 3f29eca commit 2b4b86b
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: release

on:
push:
branches:
- main
tags:
- *
workflow_dispatch:

jobs:
release:
name: Release

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

# Configure build steps as you'd normally do

- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'oracle'
cache: gradle

# Create a release

- name: Run JReleaser
uses: jreleaser/release-action@v2
env:
JRELEASER_GITHUB_TOKEN: ${{ github.token }}
JRELEASER_DOCKER_GHCR_USERNAME: ${{ github.actor }}
JRELEASER_DOCKER_GHCR_PASSWORD: ${{ github.token }}
93 changes: 92 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import org.jreleaser.model.Active
import org.jreleaser.model.Distribution.DistributionType
import org.jreleaser.model.Stereotype

val ktor_version: String by project
val kotlin_version: String by project
val logback_version: String by project
Expand All @@ -10,10 +14,11 @@ plugins {
kotlin("jvm") version "1.9.21"
id("io.ktor.plugin") version "2.3.6"
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.21"
id("org.jreleaser") version "1.9.0"
}

group = "com.ahdark.code"
version = "0.0.1"
version = "1.0.0"

application {
mainClass.set("com.ahdark.code.ApplicationKt")
Expand All @@ -22,6 +27,92 @@ application {
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}

jreleaser {
project {
name = "ahdark-blog-releaser"
stereotype = Stereotype.WEB
description = "AHdark Blog Release Notification Service"
longDescription = """
This project is a Kotlin-based HTTP server designed to handle GitHub Webhooks. It automatically forwards push notifications from the main branch of a GitHub repository to a specified Telegram chat, facilitating real-time updates.
""".trimIndent()
license = "MIT"
authors = listOf("AHdark")
maintainers = listOf("AH-dark")
inceptionYear = "2023"
website = "https://github.com/aH-dark/ahdark-blog-releaser"
docsUrl = "https://github.com/AH-dark/ahdark-blog-releaser/wiki"

java {
version = "21"
}
}

release {
github {
repoOwner = "ahdark"
overwrite = true
}
}

checksum {
name = "{{projectName}}-{{projectVersion}}_checksums.txt"

algorithm("MD5")
algorithm("SHA-256")

individual = true
artifacts = true
files = true
}

distributions {
create("app") {
active = Active.RELEASE
distributionType = DistributionType.JAVA_BINARY

platform {
replacements.put("osx-x86_64", "mac")
replacements.put("aarch_64", "aarch64")
replacements.put("x86_64", "amd64")
replacements.put("linux_musl", "alpine")
}

artifacts {
artifact {
path = File("build/{{distributionName}}-{{projectVersion}}.zip")
}
artifact {
path = File("build/{{distributionName}}-{{projectVersion}}-mac.zip")
platform = "osx"
}
artifact {
path = File("build/{{distributionName}}-{{projectVersion}}-windows.zip")
platform = "windows"
}
}
}
}

packagers {
docker {
active = Active.RELEASE

buildx {
enabled = true

platform("linux/amd64")
platform("linux/arm64")
}

registries {
create("ghcr") {
server = "https://ghcr.io"
}
}
}
}
}

repositories {
mavenCentral()
maven("https://jitpack.io")
Expand Down

0 comments on commit 2b4b86b

Please sign in to comment.