Meshtastic-Android/.github/workflows/publish-core.yml
James Rich 8eb5970ca8 feat: upgrade build environment to JDK 21 and centralize CI configuration
- Create a composite GitHub Action `gradle-setup` to encapsulate code checkout, wrapper validation, JDK 21 setup, and Gradle caching logic.
- Update all GitHub workflows (`publish-core`, `codeql`, `scheduled-updates`, `release`, etc.) to utilize the new centralized `gradle-setup` action.
- Upgrade the project's primary JDK requirement from 17 to 21 across `jitpack.yml`, workflow files, and build-logic conventions.
- Refactor `KotlinAndroid.kt` and `build.gradle.kts` to target JVM 21 for the application while maintaining JVM 17 compatibility for published library modules (`api`, `model`, `proto`).
- Introduce a new `build-desktop` job in `reusable-check.yml` to verify desktop artifact assembly during CI.
- Implement dynamic `cache_read_only` detection in workflows to optimize Gradle cache usage across different branch types and merge groups.
- Update project documentation (`GEMINI.md`, `AGENTS.md`, `CONTRIBUTING.md`) to reflect the JDK 21 requirement and provide guidance on Robolectric configuration for the new version.
2026-03-27 09:32:21 -05:00

49 lines
1.4 KiB
YAML

name: Publish Core Libraries
on:
release:
types: [created]
workflow_dispatch:
inputs:
version_suffix:
description: 'Version suffix (e.g. -alpha01, -SNAPSHOT)'
required: false
default: '-SNAPSHOT'
jobs:
publish:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Gradle Setup
uses: ./.github/actions/gradle-setup
- name: Configure Version
id: version
env:
EVENT_NAME: ${{ github.event_name }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
VERSION_SUFFIX: ${{ inputs.version_suffix }}
run: |
if [[ "$EVENT_NAME" == "release" ]]; then
echo "VERSION_NAME=$RELEASE_TAG" >> $GITHUB_ENV
else
# Use a timestamp-based version for manual/branch builds to avoid collisions
# or use the base version + suffix
BASE_VERSION=$(grep "VERSION_NAME_BASE" config.properties | cut -d'=' -f2)
echo "VERSION_NAME=${BASE_VERSION}${VERSION_SUFFIX}" >> $GITHUB_ENV
fi
- name: Publish to GitHub Packages
run: ./gradlew :core:api:publish :core:model:publish :core:proto:publish
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}