Skip to content

Skip custom signing key #7

Skip custom signing key

Skip custom signing key #7

Workflow file for this run

name: 'Tauri Android'
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
jobs:
publish-android:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Drop orphan tags
continue-on-error: true
uses: fabriziocacicia/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set Environment GIT_HASH
run: |
GIT_HASH=$(git rev-parse --short HEAD)
echo "GIT_HASH=${GIT_HASH}" >> $GITHUB_ENV
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install NDK
run: sdkmanager "ndk;27.0.11902837"
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
- name: Install package manager
run: pnpm install
- name: Initialize app bundle
run: pnpm tauri android init
env:
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.11902837
- name: Build app bundle
run: pnpm tauri android build
env:
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.11902837
- name: Modify AndroidManifest
run: |
java -jar ManifestEditor-2.0.jar -aa "android-usesCleartextTraffic:true" src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk
java -jar uber-apk-signer-1.3.0.jar -apks src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned-unsigned.apk
- name: Get Node project version
id: package-version
uses: martinbeentjes/[email protected]
- name: Rename APK file
run: |
mv ./src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-aligned-debugSigned.apk ./src-tauri/gen/android/app/build/outputs/apk/universal/release/segment-editor-${{ steps.package-version.outputs.current-version}}.apk
- name: Purge past releases
uses: dev-drprasad/[email protected]
with:
keep_latest: 1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish
uses: softprops/[email protected]
with:
draft: false
name: Segment Editor v${{ steps.package-version.outputs.current-version}}-${{ env.GIT_HASH }}
tag_name: ${{ steps.package-version.outputs.current-version}}-${{ env.GIT_HASH }}
generate_release_notes: true
files: src-tauri/gen/android/app/build/outputs/apk/universal/release/segment-editor-*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}