-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (92 loc) · 3.12 KB
/
Copy pathbuild-android-release.yml
File metadata and controls
103 lines (92 loc) · 3.12 KB
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
96
97
98
99
100
101
102
103
name: "Main Branch Release Build"
on:
push:
branches: [ main ]
workflow_dispatch:
inputs:
deploy_target:
description: 'Deploy-Ziel (internal, alpha)'
required: true
default: 'internal'
type: choice
options:
- internal
- alpha
jobs:
build-release:
name: "Build & Deploy Release"
runs-on: ubuntu-latest
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Set up Java"
uses: actions/setup-java@v4
with:
distribution: "oracle"
java-version: "22"
- name: "Set up Gradle"
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper
- name: "Set up Flutter"
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-file: pubspec.yaml
cache: true
- name: "Setup Ruby"
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
working-directory: 'android'
bundler-cache: true
- name: Set up keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
echo "CI=true" >> $GITHUB_ENV
echo "KEYSTORE_BASE64=$KEYSTORE_BASE64" >> $GITHUB_ENV
echo "KEYSTORE_PASSWORD=$KEYSTORE_PASSWORD" >> $GITHUB_ENV
echo "KEY_ALIAS=$KEY_ALIAS" >> $GITHUB_ENV
echo "KEY_PASSWORD=$KEY_PASSWORD" >> $GITHUB_ENV
- name: Setup Google Play credentials
env:
PLAY_STORE_JSON_KEY_BASE64: ${{ secrets.PLAY_STORE_JSON_KEY_BASE64 }}
run: |
echo $PLAY_STORE_JSON_KEY_BASE64 | base64 --decode > play-store-credentials.json
echo "PLAYSTORE_JSON_KEY_PATH=$(pwd)/play-store-credentials.json" >> $GITHUB_ENV
- name: Determine deploy target
id: deploy-target
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "DEPLOY_TO=${{ github.event.inputs.deploy_target }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "DEPLOY_TO=alpha" >> $GITHUB_ENV
else
echo "DEPLOY_TO=internal" >> $GITHUB_ENV
fi
- name: "Run Fastlane Release Build and Deploy"
id: fastlane
uses: maierj/fastlane-action@v3.1.0
with:
lane: build_release_and_deploy
subdirectory: android
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DEPLOY_TO: ${{ env.DEPLOY_TO }}
- name: "Upload Release Artifacts"
uses: actions/upload-artifact@v4
with:
name: movetopia-release
path: android/fastlane/build/outputs/
- name: "Create GitHub Release"
uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
prerelease: false
tag: ${{ env.VERSION_NAME }}
name: ${{ env.VERSION_NAME }}
artifacts: "android/fastlane/build/outputs/*"