Skip to content

Publish 0.3.0 download and upgrade guidance #13

Publish 0.3.0 download and upgrade guidance

Publish 0.3.0 download and upgrade guidance #13

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
public-content:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check public file policy and reviewed assets
run: |
python3 scripts/check_public.py
python3 scripts/check_docs.py
python3 -m unittest discover -s scripts -p test_public.py
- name: Scan the published tree for credentials
env:
GITLEAKS_VERSION: 8.30.1
GITLEAKS_SHA256: 551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb
run: |
curl --fail --location --silent --show-error --retry 3 \
"https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
--output "$RUNNER_TEMP/gitleaks.tar.gz"
printf '%s %s\n' "$GITLEAKS_SHA256" "$RUNNER_TEMP/gitleaks.tar.gz" | sha256sum --check -
tar -xzf "$RUNNER_TEMP/gitleaks.tar.gz" -C "$RUNNER_TEMP" gitleaks
mkdir -p "$RUNNER_TEMP/public-tree"
git archive HEAD | tar -x -C "$RUNNER_TEMP/public-tree"
"$RUNNER_TEMP/gitleaks" dir "$RUNNER_TEMP/public-tree" --redact --no-banner --max-archive-depth 2
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python: "3.11"
modern: "false"
artifact: universal
- python: "3.13"
modern: "true"
artifact: modern
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
# Chaquopy builds against the exact minor on PATH.
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# Runners already ship an SDK; just point at it and accept
# licenses. (android-actions/setup-android is broken against
# current cmdline-tools — it wants the obsolete `tools` package.)
# AGP downloads platform/build-tools 35 itself on first build.
- name: Android SDK
run: |
echo "ANDROID_HOME=/usr/local/lib/android/sdk" >> $GITHUB_ENV
echo "ANDROID_SDK_ROOT=/usr/local/lib/android/sdk" >> $GITHUB_ENV
yes | /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager --licenses >/dev/null 2>&1 || true
- uses: gradle/actions/setup-gradle@v3
- name: Compile and lint Android runtime
run: ./gradlew -PmodernRuntime=${{ matrix.modern }} :app:assembleDebug :app:assembleDebugAndroidTest :app:assembleRelease :app:lintDebug --no-daemon
- name: Verify modern native alignment
if: matrix.modern == 'true'
run: python scripts/check_apk.py app/build/outputs/apk/debug/app-debug.apk --require-16k
- name: Package development APK and checksum
run: |
mkdir -p dist
cp app/build/outputs/apk/debug/app-debug.apk dist/muse-gadget-${{ matrix.artifact }}-debug.apk
cd dist
sha256sum *.apk > SHA256SUMS
- uses: actions/upload-artifact@v4
with:
name: muse-gadget-${{ matrix.artifact }}-debug
path: |
dist/muse-gadget-${{ matrix.artifact }}-debug.apk
dist/SHA256SUMS
retention-days: 14
if-no-files-found: error
- name: Check documentation links
run: python scripts/check_docs.py
- name: Python overlay tests
if: matrix.modern == 'false'
run: |
python3.11 -m pip install -q pytest==8.3.4 cryptography==42.0.8 websockets==17.2 paho-mqtt==2.1.0
PYTHONPATH=app/src/main/python:vendor/muse-gadget-sdk/linux/src \
python3.11 -m pytest app/src/main/python/androidtv/tests/ vendor/muse-gadget-sdk/linux/tests/ -q