Files
Shiroha/.github/workflows/publish-api.yml
T
Bacteria 16f5ff22de Checkout submodules recursively in workflows
Add 'submodules: recursive' to the actions/checkout step in build-pr.yml, build.yml, and publish-api.yml so CI jobs fetch repository submodules. This ensures submodules are available during builds and aligns checkout configuration across workflows (keeping fetch-depth: 0 where already set).
2026-07-09 18:51:02 +08:00

53 lines
1.4 KiB
YAML

name: Publish API
on:
push:
branches:
- "**"
workflow_dispatch:
jobs:
publish:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repository
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
- name: Get Branch Build Number
run: |
BUILD_NUMBER=$(git rev-list --count HEAD)
echo "BUILD_NUMBER=$BUILD_NUMBER" >> $GITHUB_ENV
- name: Set Up JDK
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 25
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Configure Git User Details
run: |
git config --global user.email "ci@monnairealms.moe"
git config --global user.name "Camellia CI"
- name: Grant Execute Permission
run: chmod +x gradlew
- name: Apply Patches
run: ./gradlew applyAllPatches --stacktrace
- name: Publish API to Maven
continue-on-error: true
run: |
./gradlew :camellia-api:publish
./gradlew generateDevelopmentBundle publishDevBundlePublicationToBacteriawaRepository -PpublishDevBundle=true
env:
MAVEN_REPO_PASSWORD: ${{ secrets.MAVEN_REPO_PASSWORD }}
MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }}