ci: 配置 Gitea 自动构建脚本
All checks were successful
Publish Project / build (push) Successful in 2m10s

This commit is contained in:
2025-07-30 21:12:20 +08:00
parent 268eaf5e7a
commit fc07d5e03a
2 changed files with 32 additions and 4 deletions

View File

@@ -0,0 +1,29 @@
name: Publish Project
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle
cache-dependency-path: gradle/wrapper/gradle-wrapper.properties
- name: Build Project
env:
ORG_GRADLE_PROJECT_MAVEN_AIRGAME_USERNAME: ${{ secrets.MAVEN_AIRGAME_USERNAME }}
ORG_GRADLE_PROJECT_MAVEN_AIRGAME_PASSWORD: ${{ secrets.MAVEN_AIRGAME_PASSWORD }}
run: chmod +x gradlew && ./gradlew build publish --no-daemon
- name: Publish to Release
uses: softprops/action-gh-release@v2
with:
files: build/*.jar

View File

@@ -56,11 +56,10 @@ publishing {
}
repositories {
maven {
url = uri("https://maven.airgame.net/public/")
url = uri("https://maven.airgame.net/public")
credentials {
username = rootProject.properties.getOrDefault("maven_username", "").toString()
password = rootProject.properties.getOrDefault("maven_password", "").toString()
username = findProperty("MAVEN_AIRGAME_USERNAME")?.toString() ?: ""
password = findProperty("MAVEN_AIRGAME_PASSWORD")?.toString() ?: ""
}
}
}