Skip to content

Commit

Permalink
[workflow] added build-android-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
liplum committed Nov 20, 2024
1 parent 3e5e879 commit 75c5fdd
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 8 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build-android-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Flutter Build Android Release

on: workflow_dispatch

jobs:
build_android:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- uses: actions/checkout@v4
with:
repository: plum-tech/mimir-x
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: tools/pnpm-lock.yaml

- name: Pnpm install
run: |
cd tools && pnpm i && pnpm build && cd ..
- name: Install JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
flutter-version-file: pubspec.yaml

- name: Build APK
run: |
flutter config --no-cli-animations
flutter build apk --target-platform android-arm,android-arm64 --split-per-abi
- name: Sign APK
uses: r0adkll/sign-android-release@v1
id: sign_apk
with:
releaseDirectory: build/app/outputs/flutter-apk
signingKeyBase64: ${{ secrets.APK_SIGN_JKS_BASE64 }}
keyStorePassword: ${{ secrets.APK_SIGN_JKS_PASSWORD }}
keyPassword: ${{ secrets.APK_SIGN_ALIAS_PASS }}
alias: ${{ secrets.APK_SIGN_ALIAS }}
env:
BUILD_TOOLS_VERSION: "34.0.0"

- name: Publish Android Artifact
uses: actions/upload-artifact@v4
with:
name: Android-release
path: build/app/outputs/flutter-apk/*-signed.apk
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:

- name: Pnpm install
run: |
cd tools && pnpm i && cd ..
cd tools && pnpm i && pnpm build && cd ..
- name: Change version
run: |
node tools/increment-build-number.js
pnpm -C tools run increment-build-number
- name: Install JDK 17
uses: actions/setup-java@v4
Expand Down Expand Up @@ -94,15 +94,15 @@ jobs:

- name: Pnpm install
run: |
cd tools && pnpm i && cd ..
cd tools && pnpm i && pnpm build && cd ..
- name: Change version
run: |
node tools/increment-build-number.js
pnpm -C tools run increment-build-number
- name: Change Develop to Distribution
run: |
node tools/to-distro.js
pnpm -C tools run to-distro
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v3
Expand Down Expand Up @@ -174,13 +174,13 @@ jobs:

- name: Pnpm install
run: |
cd tools && pnpm i && cd ..
cd tools && pnpm i && pnpm build && cd ..
- name: Change version and push tag
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
node tools/increment-build-number.js --push
pnpm -C tools run increment-build-number --push
- name: Get iOS Artifact
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -214,4 +214,4 @@ jobs:
env:
MIMIR_VERSION_TOKEN: ${{ secrets.MIMIR_VERSION_ADMIN_TOKEN }}
run: |
node tools/publish-preview.js --upload build/app-release-signed.apk
pnpm -C tools run publish-preview --upload build/app-release-signed.apk

0 comments on commit 75c5fdd

Please sign in to comment.