mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-18 11:46:28 -04:00
Gradle: Add flatpakGradleGenerator task (#5369)
This commit is contained in:
@@ -131,6 +131,7 @@ jobs:
|
||||
channel: ${{ inputs.channel }}
|
||||
base_version: ${{ inputs.base_version }}
|
||||
build_desktop: ${{ inputs.build_desktop }}
|
||||
build_flatpak_src: ${{ inputs.build_desktop }}
|
||||
secrets: inherit
|
||||
|
||||
call-promote-workflow:
|
||||
|
||||
105
.github/workflows/release.yml
vendored
105
.github/workflows/release.yml
vendored
@@ -24,6 +24,11 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
build_flatpak_src:
|
||||
description: 'Whether to build the Flatpak sources'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
secrets:
|
||||
GSERVICES:
|
||||
required: true
|
||||
@@ -339,10 +344,105 @@ jobs:
|
||||
desktop/build/compose/binaries/main-release/*/*.AppImage
|
||||
desktop/build/compose/jars/*-release.jar
|
||||
|
||||
create-flatpak-src:
|
||||
if: ${{ inputs.build_flatpak_src }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: [prepare-build-info]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-22.04, ubuntu-22.04-arm]
|
||||
env:
|
||||
GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
|
||||
GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}
|
||||
GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_CACHE_PASSWORD }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ inputs.tag_name }}
|
||||
fetch-depth: 0
|
||||
submodules: 'recursive'
|
||||
|
||||
- name: Gradle Setup
|
||||
uses: ./.github/actions/gradle-setup
|
||||
with:
|
||||
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
cache_read_only: 'true'
|
||||
|
||||
- name: Python Setup
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install ast-grep
|
||||
run: pip install ast-grep-cli
|
||||
|
||||
# Remove Android/iOS targets and other non-desktop bits
|
||||
# that would break the flatpakGradleGenerator
|
||||
- name: Prepare Offline Desktop Build
|
||||
run: ./scripts/desktop-only-prep.sh
|
||||
|
||||
- name: Generate Flatpak Sources
|
||||
env:
|
||||
DESKTOP_ONLY: true
|
||||
run: >
|
||||
./gradlew :build-logic:convention:flatpakGradleGenerator flatpakGradleGenerator
|
||||
--no-configuration-cache --refresh-dependencies --no-parallel
|
||||
|
||||
- name: List Flatpak source files
|
||||
run: ls -R flatpak-sources*.json
|
||||
|
||||
- name: Upload Flatpak source artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: flatpak-multisrc-${{ runner.arch }}
|
||||
path: flatpak-sources*.json
|
||||
retention-days: 1
|
||||
|
||||
release-flatpak-src:
|
||||
if: ${{ inputs.build_flatpak_src }}
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [create-flatpak-src]
|
||||
steps:
|
||||
- name: Download Flatpak source artifacts
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
pattern: flatpak-multisrc-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: List Flatpak source files
|
||||
run: ls -R flatpak-sources*.json
|
||||
|
||||
- name: Combine Flatpak source files
|
||||
run: >
|
||||
jq -s 'add | unique_by(.dest + "/" + .["dest-filename"])' flatpak-sources*.json
|
||||
> flatpak-sources.json
|
||||
|
||||
- name: Upload combined Flatpak source artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: flatpak-sources
|
||||
path: flatpak-sources.json
|
||||
retention-days: 1
|
||||
|
||||
- name: Attest combined Flatpak source artifact provenance
|
||||
if: success()
|
||||
uses: actions/attest@v4
|
||||
with:
|
||||
subject-path: flatpak-sources.json
|
||||
|
||||
github-release:
|
||||
if: ${{ !cancelled() && !failure() }}
|
||||
runs-on: ubuntu-24.04-arm
|
||||
needs: [prepare-build-info, release-google, release-fdroid, release-desktop]
|
||||
needs:
|
||||
- prepare-build-info
|
||||
- release-google
|
||||
- release-fdroid
|
||||
- release-desktop
|
||||
- release-flatpak-src
|
||||
env:
|
||||
INTERNAL_BUILDS_HOST: ${{ secrets.INTERNAL_BUILDS_HOST }}
|
||||
permissions:
|
||||
@@ -360,6 +460,9 @@ jobs:
|
||||
with:
|
||||
path: ./artifacts
|
||||
|
||||
- name: Exclude flatpak-multisrc artifacts from release
|
||||
run: rm -rf ./artifacts/flatpak-multisrc-*
|
||||
|
||||
- name: Create or Update GitHub Release
|
||||
uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
|
||||
62
.github/workflows/reusable-check.yml
vendored
62
.github/workflows/reusable-check.yml
vendored
@@ -15,6 +15,9 @@ on:
|
||||
run_desktop_builds:
|
||||
type: boolean
|
||||
default: true
|
||||
run_desktop_flatpak_src:
|
||||
type: boolean
|
||||
default: true
|
||||
upload_artifacts:
|
||||
type: boolean
|
||||
default: true
|
||||
@@ -490,3 +493,62 @@ jobs:
|
||||
name: desktop-app-${{ runner.os }}-${{ runner.arch }}
|
||||
path: desktop/build/compose/binaries/main/app/
|
||||
retention-days: 7
|
||||
|
||||
# ── Flatpak Sources ───────────────────────────────────────────────────
|
||||
build-flatpak-src:
|
||||
name: Generate Flatpak Sources (${{ matrix.os }})
|
||||
if: inputs.run_desktop_flatpak_src == true
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 60
|
||||
needs: lint-check
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-24.04, ubuntu-24.04-arm]
|
||||
env:
|
||||
VERSION_CODE: ${{ needs.lint-check.outputs.version_code }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: true
|
||||
|
||||
- name: Gradle Setup
|
||||
uses: ./.github/actions/gradle-setup
|
||||
with:
|
||||
gradle_encryption_key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
cache_read_only: true
|
||||
|
||||
- name: Python Setup
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install ast-grep
|
||||
run: pip install ast-grep-cli
|
||||
|
||||
# Remove Android/iOS targets and other non-desktop bits
|
||||
# that would break the flatpakGradleGenerator
|
||||
- name: Prepare Offline Desktop Build
|
||||
run: ./scripts/desktop-only-prep.sh
|
||||
|
||||
- name: Generate Flatpak Sources
|
||||
env:
|
||||
DESKTOP_ONLY: true
|
||||
run: >
|
||||
./gradlew :build-logic:convention:flatpakGradleGenerator flatpakGradleGenerator
|
||||
--no-configuration-cache --refresh-dependencies --no-parallel
|
||||
|
||||
- run: ls -lah flatpak-sources*.json
|
||||
|
||||
- name: Upload Flatpak Sources
|
||||
if: ${{ inputs.upload_artifacts }}
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: flatpak-sources-${{ runner.arch }}
|
||||
path: flatpak-sources*.json
|
||||
retention-days: 7
|
||||
|
||||
Reference in New Issue
Block a user