mirror of
https://github.com/layue13/MoonBridge.git
synced 2026-10-25 18:46:18 +00:00
- 根任务 release:build/release/ 下收集服务器包、后端插件 JAR 与客户端 mod (经 client-mod 自身 wrapper 构建,-PskipClientMod 可跳过),附安装位置说明 docs/release-layout.md - verify.yml:-Pluckperms check,并新增 client-mod 构建测试 job; ci.yml:-Pluckperms check release,上传 build/release/,发布带 -Pluckperms - gradlew 加可执行位 - README、CLAUDE.md、架构/发布/测试/权限/后端接入文档与 smoke 脚本改用新模块、 新坐标与发行包 backend/ 目录 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
75 lines
2.3 KiB
YAML
75 lines
2.3 KiB
YAML
name: Build and publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
inputs:
|
|
publish:
|
|
description: Publish the Maven modules ('true' or 'false')
|
|
required: false
|
|
default: 'true'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
|
|
with:
|
|
persist-credentials: false
|
|
submodules: recursive
|
|
|
|
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6
|
|
with:
|
|
distribution: zulu
|
|
java-version: '25'
|
|
|
|
- name: Set development version
|
|
run: echo "ORG_GRADLE_PROJECT_releaseVersion=0.1.0-dev.${GITHUB_RUN_ID}.${GITHUB_RUN_ATTEMPT:-1}.${GITHUB_SHA:0:12}" >> "$GITHUB_ENV"
|
|
|
|
- name: Check and assemble the release
|
|
run: bash ./gradlew --no-daemon -Pluckperms check release
|
|
|
|
- name: Upload build outputs
|
|
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
|
|
with:
|
|
name: moonbridge-development
|
|
path: build/release/
|
|
if-no-files-found: error
|
|
retention-days: 30
|
|
|
|
publish:
|
|
# Runs only after the build above passed. The Maven credentials exist in this job and nowhere else.
|
|
needs: build
|
|
if: ${{ github.event_name == 'push' || inputs.publish == 'true' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
env:
|
|
MAVEN_USER: ${{ secrets.MAVEN_USER }}
|
|
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
|
|
steps:
|
|
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
|
|
with:
|
|
persist-credentials: false
|
|
submodules: recursive
|
|
|
|
- uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6
|
|
with:
|
|
distribution: zulu
|
|
java-version: '25'
|
|
|
|
- name: Set development version
|
|
run: echo "ORG_GRADLE_PROJECT_releaseVersion=0.1.0-dev.${GITHUB_RUN_ID}.${GITHUB_RUN_ATTEMPT:-1}.${GITHUB_SHA:0:12}" >> "$GITHUB_ENV"
|
|
|
|
- name: Check the publish credentials
|
|
run: |
|
|
if [[ -z "$MAVEN_USER" || -z "$MAVEN_PASSWORD" ]]; then
|
|
echo "::error::MAVEN_USER and MAVEN_PASSWORD are not set; cannot publish"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Publish all Maven modules
|
|
run: bash ./gradlew --no-daemon -Pluckperms publish
|