Files
youtube-generator/.github/workflows/release-android.yml
T
dependabot[bot] b3d6190d06 ci: bump the actions group with 3 updates
Bumps the actions group with 3 updates: [SonarSource/sonarqube-scan-action](https://github.com/sonarsource/sonarqube-scan-action), [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) and [actions/setup-java](https://github.com/actions/setup-java).


Updates `SonarSource/sonarqube-scan-action` from 8.4.0 to 8.4.1
- [Release notes](https://github.com/sonarsource/sonarqube-scan-action/releases)
- [Commits](https://github.com/sonarsource/sonarqube-scan-action/compare/4d1dc0c91ee400dcf8a6dddf2f705ac36542e304...e805d875275f728fac1885b413934be6d7c63f65)

Updates `amannn/action-semantic-pull-request` from 6.1.1 to 6.1.2
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md)
- [Commits](https://github.com/amannn/action-semantic-pull-request/compare/48f256284bd46cdaab1048c3721360e808335d50...2252a14e810aa9b85c2d560bd7070c802206ecf6)

Updates `actions/setup-java` from 6.1.0 to 6.2.0
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/b843ebf9b913146b38da2eaa7aeddf76074ae1ad...77dd5b2ce225ea11469928ac317850245a74ae78)

---
updated-dependencies:
- dependency-name: SonarSource/sonarqube-scan-action
  dependency-version: 8.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: amannn/action-semantic-pull-request
  dependency-version: 6.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/setup-java
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-16 13:46:39 +00:00

139 lines
5.5 KiB
YAML

name: Release Android
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Tag to build (e.g. v1.0.0). The manifests must already carry this version."
required: true
type: string
permissions:
contents: read
jobs:
# Same gate as release-desktop.yml: never sign an APK for a tag whose code
# fails the checks or whose version fields disagree with the tag.
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.inputs.tag || github.ref }}
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
# by any other workflow must not be able to feed into them.
package-manager-cache: false
- run: npm ci --ignore-scripts
- run: npm run typecheck
- run: npm run test:run
- run: npm run check:version
- run: npm run check:tauri
- name: Tag matches the manifests
env:
TAG: ${{ github.event.inputs.tag || github.ref_name }}
run: |
version="v$(node -p "require('./package.json').version")"
if [ "$version" != "$TAG" ]; then
echo "::error::Tag $TAG does not match package.json ($version)"
exit 1
fi
build-android:
needs: verify
runs-on: ubuntu-latest
permissions:
contents: write # upload the APK to the draft release
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.inputs.tag || github.ref }}
persist-credentials: false
# No dependency caches in a release job (see release-desktop.yml).
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .node-version
# Release artifacts are built from a clean install: a cache written
# by any other workflow must not be able to feed into them.
package-manager-cache: false
- uses: actions/setup-java@77dd5b2ce225ea11469928ac317850245a74ae78 # v6.2.0
with:
distribution: temurin
java-version: "17"
- uses: android-actions/setup-android@be39fa834029ff78f1a44aa3bb0819b8fc2bd8fd # v4.0.4
- name: Install Android NDK (r27 LTS)
run: sdkmanager "ndk;27.3.13750724"
# A master commit, not the regenerated `stable` branch — see rust.yml.
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8
with:
toolchain: stable
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
- run: npm ci --ignore-scripts
- name: Install Tauri CLI
run: cargo install tauri-cli --version "^2" --locked
- name: Decode keystore
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
run: echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > "$RUNNER_TEMP/release.jks"
- name: Write keystore.properties
env:
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
run: |
{
echo "storeFile=$RUNNER_TEMP/release.jks"
echo "storePassword=$ANDROID_STORE_PASSWORD"
echo "keyAlias=$ANDROID_KEY_ALIAS"
echo "keyPassword=$ANDROID_KEY_PASSWORD"
} > src-tauri/gen/android/keystore.properties
- name: Build signed APK
env:
# Pin NDK_HOME to the exact version we installed above — the runner may
# ship a different default NDK that ANDROID_NDK_ROOT would point at.
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.3.13750724
run: cargo tauri android build --apk
# Keep the APK regardless of whether the release upload works, so a
# broken upload never costs a 20-minute rebuild.
- name: Upload APK as workflow artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: ytdescgen-android-apk
path: src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
if-no-files-found: error
# Uses `gh` (pre-installed on every runner) rather than a third-party
# action. `softprops/action-gh-release@v3` resolved the target release
# from GITHUB_REF instead of the `tag_name` it was given, so on a tag push
# it looked for a release tagged `refs/tags/v0.35.0` and on a
# workflow_dispatch it looked for one tagged `refs/heads/main` — neither
# exists, so it tried to CREATE a release on a branch ref and got
# "Resource not accessible by integration". The v0.35.0 APK was built
# three times before this was pinned down.
#
# `gh release upload` takes the tag as a positional argument and cannot
# make that mistake. `--clobber` makes a re-run idempotent.
- name: Upload APK to draft release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.event.inputs.tag || github.ref_name }}
REPO: ${{ github.repository }}
APK: src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
run: |
gh release upload "$TAG" "$APK" --clobber --repo "$REPO"