From cb913d51d9647062741c0550a8b8033506c5cffd Mon Sep 17 00:00:00 2001 From: lanzhi6 Date: Tue, 25 Jun 2024 12:51:08 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E6=B7=BB=E5=8A=A0Github=20action?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 22 ++++++++++++++++++++++ src/main/kotlin/subit/config/Config.kt | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ec696e3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,22 @@ +name: build +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # 安装 JDK 17 + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + distribution: 'adopt' + java-version: '17' + # 执行 Gradle 构建 + - name: Build with Gradle + run: ./gradlew build + # 上传构建产物 + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: Subit ForumBackendKtor Artifact + path: build/libs/*.jar \ No newline at end of file diff --git a/src/main/kotlin/subit/config/Config.kt b/src/main/kotlin/subit/config/Config.kt index d7e4afd..7cd6ec4 100644 --- a/src/main/kotlin/subit/config/Config.kt +++ b/src/main/kotlin/subit/config/Config.kt @@ -62,7 +62,7 @@ class ConfigLoader private constructor( @Suppress("unused", "MemberVisibilityCanBePrivate") companion object { - private val logger = ForumLogger.getLogger() + private val logger by lazy { ForumLogger.getLogger() } fun init() // 初始化所有配置 { apiDocsConfig