Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/mockup-apk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Build the PFD layout mockup APK.
#
# The APK is deliberately not committed to the repository: .gitignore excludes
# *.apk on purpose, and a binary in git rots. This workflow is where the APK
# comes from instead. Every run publishes it as a downloadable artifact, and
# pushing a mockup-v* tag also attaches it to a GitHub release.
#
# SPDX-License-Identifier: GPL-2.0-or-later

name: Mockup APK

on:
push:
branches: [main]
paths: ['app/mockup/**', '.github/workflows/mockup-apk.yml']
tags: ['mockup-v*']
pull_request:
paths: ['app/mockup/**', '.github/workflows/mockup-apk.yml']
workflow_dispatch:

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

# build-tools 35 or newer is required. The d8 in 34.0.0 predates JDK 21
# and fails on every class with an opaque NPE while writing the dex.
- name: Install SDK packages
run: |
yes 2>/dev/null | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses >/dev/null || true
"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" \
"platforms;android-34" "build-tools;35.0.0"

- name: Build APK
run: ./app/mockup/android/build.sh

- name: Check the APK is well formed
run: |
APK=app/mockup/android/build/junco-pfd-mockup.apk
BT="$ANDROID_HOME/build-tools/35.0.0"
test -f "$APK"
"$BT/apksigner" verify "$APK"
# The whole point of the wrapper is that the web assets ship inside it.
for f in index.html manifest.webmanifest sw.js icon-192.png icon-512.png; do
unzip -l "$APK" | grep -q "assets/$f" || { echo "missing assets/$f"; exit 1; }
done
"$BT/aapt2" dump badging "$APK" | grep -q "package: name='org.junco.mockup'"
echo "APK OK: $(du -h "$APK" | cut -f1)"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: junco-pfd-mockup-apk
path: app/mockup/android/build/junco-pfd-mockup.apk
if-no-files-found: error

- name: Attach to release
if: startsWith(github.ref, 'refs/tags/mockup-v')
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
app/mockup/android/build/junco-pfd-mockup.apk \
--title "PFD layout mockup ${GITHUB_REF_NAME}" \
--notes "Layout mockup only. Not an instrument, not airworthy, not the Junco client. Debug-signed for sideloading; enable install from unknown sources. See app/mockup/README.md." \
|| gh release upload "${GITHUB_REF_NAME}" \
app/mockup/android/build/junco-pfd-mockup.apk --clobber
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ be declined regardless of its merits elsewhere.
- Logbook entries are proposed, never filed
- Adapting to a new aircraft never requires a toolchain
- A unit always declares its build class
- Every channel declares its source, and invalid data is published as invalid
rather than held at its last value

## Licensing your contribution

Code is GPL-2.0-or-later, hardware is CERN-OHL-S-2.0, documentation and
specifications are CC-BY-4.0. By opening a pull request you agree your
contribution ships under the license covering that artifact.

Every source file starts with:

SPDX-License-Identifier: GPL-2.0-or-later

The "or later" is not optional and not decorative. It is what lets code move
between Junco and MakerPlane's FIX-Gateway and pyEFIS, which are GPL v2 or
later, and it keeps GPLv3 reachable if ArduPilot code is ever wanted. A file
contributed as GPL-2.0-only would break both.

Do not paste in code from a permissively licensed project without checking that
the attribution requirements survive the relicensing, and do not paste in code
from a GPLv3-only project at all.

## Specifications before implementations

Expand Down
359 changes: 338 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

Loading
Loading