Files
Shiroha/.github/workflows/publish-api.yml
T
Bacteria 3082c3f1d1 Add CI workflows, dependabot and env script
Introduce CI infrastructure: add Dependabot config to update GitHub Actions and Gradle dependencies weekly; add build-pr workflow to run PR builds, create the paperclip JAR, and upload artifacts; add full Camellia CI workflow to build, set environment, upload artifacts, optionally publish to Maven and create GitHub releases (with release notes and prerelease handling); add publish-api workflow to publish the API artifact. Also add scripts/SetENV.sh which reads gradle.properties, computes build/release flags, renames the paperclip jar and exports environment variables for the workflows. These changes set up automated builds, dependency maintenance, publishing and release automation for the project.
2026-07-09 18:22:49 +08:00

51 lines
1.3 KiB
YAML

name: Publish API
on:
push:
branches:
- "**"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- 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 }}