mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-27 10:11:48 -04:00
56 lines
1.6 KiB
YAML
56 lines
1.6 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-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
with:
|
|
submodules: 'recursive'
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'jetbrains'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v5
|
|
with:
|
|
build-scan-publish: true
|
|
build-scan-terms-of-use-url: 'https://gradle.com/terms-of-service'
|
|
build-scan-terms-of-use-agree: 'yes'
|
|
|
|
- name: Configure Version
|
|
id: version
|
|
run: |
|
|
if [[ "${{ github.event_name }}" == "release" ]]; then
|
|
echo "VERSION_NAME=${{ github.event.release.tag_name }}" >> $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}${{ inputs.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 }}
|