Skip to content

flicker and insert issue fix #40

flicker and insert issue fix

flicker and insert issue fix #40

name: Publish APK
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build and publish apk
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.16.9'
channel: 'stable'
- name: Set flutter version
uses: jacobtomlinson/gha-find-replace@master
with:
find: "version: 1\\.0\\.0\\+1"
replace: "version: 2.5.${{ github.run_number }}"
include: "pubspec.yaml"
- name: Replace package Paid
uses: jacobtomlinson/gha-find-replace@master
with:
find: "applicationId \".+\""
replace: "applicationId \"com.altlimit.applauncherplus\""
include: "android/app/build.gradle"
- name: Prepare mobile signing
run: |
flutter pub get
echo "${{ secrets.KEY_FILE }}" | base64 --decode > android/app/altlimit
echo -e "${{ secrets.KEY_PROPERTIES }}" >> android/key.properties
- name: Build mobile
run: |
flutter build apk --split-per-abi
- name: Prepare builds
run: |
mv build/app/outputs/flutter-apk build/apks
- uses: actions/setup-node@v2
with:
node-version: 14
- name: Upload to Release Page
uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs').promises;
const { repo: { owner, repo }, sha, runNumber } = context;
const tag_name = 'v2.5.' + runNumber;
const release = await github.repos.createRelease({
owner, repo, tag_name,
name: 'Mobile ' + tag_name,
draft: false,
target_commitish: sha
});
for (let file of await fs.readdir('./build/apks')) {
if (file.indexOf('.apk') !== -1)
await github.repos.uploadReleaseAsset({
owner, repo,
release_id: release.data.id,
name: file,
data: await fs.readFile(`./build/apks/${file}`)
});
}