-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (78 loc) · 2.63 KB
/
ci-android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Android Build
on:
workflow_dispatch:
inputs:
target_environment:
required: false
type: choice
description: Select environment
default: dev
options:
- dev
push:
paths:
- .github/**/*.yml
- scripts/**
- starterkit_app/**
branches:
- main
pull_request:
paths:
- .github/**/*.yml
- scripts/**
- starterkit_app/**
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
PROJECT_WORKING_DIRECTORY: "starterkit_app"
permissions: {}
jobs:
build-apk:
runs-on: ubuntu-latest
permissions: {}
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ruby/setup-ruby@7d3497fd78c07c0d84ebafa58d8dac60cd1f0763 # v1
with:
ruby-version: 2.7
- run: bundle install
working-directory: ${{ env.PROJECT_WORKING_DIRECTORY }}
- name: Set app environment
uses: ./.github/workflows/steps/set-app-environment
with:
target_environment: ${{ github.event.inputs.target_environment }}
- name: Set secrets file
uses: ./.github/workflows/steps/set-secrets-file
with:
secrets_file_value: ${{ secrets[env.SECRETS_FILE_KEY] }}
app_environment: ${{ env.APP_ENVIRONMENT }}
working_directory: ${{ env.PROJECT_WORKING_DIRECTORY }}
- name: Install Flutter
uses: ./.github/workflows/steps/install-flutter
with:
working_directory: ${{ env.PROJECT_WORKING_DIRECTORY }}
- name: Set java version
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: "adopt"
java-version: "17"
- name: Run code generation
uses: ./.github/workflows/steps/run-pub-get-and-code-generation
with:
generate_intl: "true"
working_directory: ${{ env.PROJECT_WORKING_DIRECTORY }}
- name: Build Android APK
run: |
bundle exec fastlane build_android_release
working-directory: ${{ env.PROJECT_WORKING_DIRECTORY }}
- name: Publish Android APK
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: android_build
path: ${{ env.PROJECT_WORKING_DIRECTORY }}/build/app/outputs/apk/release/app-release.apk