Skip to content

Correct touch button labels #22

Correct touch button labels

Correct touch button labels #22

Workflow file for this run

name: Android Release Build
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-24.04
container:
image: djvdw7f2ro/android-builder-soh:v1.0.4
permissions:
id-token: write
attestations: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Fetch annotated tag
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
git fetch origin "+refs/tags/${{ github.ref_name }}:refs/tags/${{ github.ref_name }}"
- name: Write local.properties
run: |
echo "sdk.dir=${ANDROID_SDK_ROOT}" > Android/local.properties
echo "ndk.dir=${ANDROID_NDK_HOME}" >> Android/local.properties
- name: Install host build dependencies
run: |
apt-get update
apt-get install -y $(cat .github/workflows/apt-deps.txt)
- name: Generate soh.o2r
run: |
cmake -S . -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build-linux --target GenerateSohOtr --parallel
cp soh/soh.o2r Android/app/src/main/assets/soh.o2r
- name: Decode keystore
run: |
echo '${{ secrets.ANDROID_KEYSTORE_BASE64 }}' | base64 -d > Android/app/release.jks
- name: Build release APK
env:
GIT_TAG: ${{ github.ref_name }}
run: |
cd Android && ./gradlew assembleRelease \
-PstoreFile=release.jks \
-PstorePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} \
-PkeyAlias=${{ secrets.ANDROID_KEY_ALIAS }} \
-PkeyPassword=${{ secrets.ANDROID_KEY_PASSWORD }}
- name: Rename APK
run: |
APK=$(find Android/app/build/outputs/apk/release -name 'soh_release_*.apk' | head -1)
mv "$APK" "soh-${{ github.ref_name }}.apk"
- name: Compute SHA256
id: sha256
run: |
HASH=$(sha256sum "soh-${{ github.ref_name }}.apk" | awk '{print $1}')
echo "hash=${HASH}" >> "$GITHUB_OUTPUT"
- name: Attest build provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: soh-${{ github.ref_name }}.apk
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG="${{ github.ref_name }}"
OBJ_TYPE=$(git tag -l --format='%(objecttype)' "${TAG}")
if [ "${OBJ_TYPE}" != "tag" ]; then
echo "ERROR: '${TAG}' is a lightweight tag. Push an annotated tag to trigger a release."
exit 1
fi
ANNOTATION_BODY=$(git tag -l --format='%(contents:body)' "${TAG}")
if [ -z "${ANNOTATION_BODY}" ]; then
ANNOTATION_BODY=$(printf '## Changes\n- Built from %s via CI' "${TAG}")
fi
printf '%s\n\n' "${ANNOTATION_BODY}" > /tmp/release-notes.md
printf 'SHA256: %s\n' "${{ steps.sha256.outputs.hash }}" >> /tmp/release-notes.md
printf 'Verify: `gh attestation verify soh-%s.apk --owner linkzenic`\n' "${TAG}" >> /tmp/release-notes.md
printf 'Build: %s/%s/actions/runs/%s\n' "${{ github.server_url }}" "${{ github.repository }}" "${{ github.run_id }}" >> /tmp/release-notes.md
gh release create "${TAG}" \
"soh-${TAG}.apk" \
--title "${TAG}" \
--notes-file /tmp/release-notes.md